yao/integrations/telegram/bot_test.go
Max ea9e070f29 Enhance robot integration with Telegram and improve event handling
- Add Telegram integration support by introducing a dispatcher for handling Telegram events and messages.
- Implement event notifications for robot configuration changes (creation, update, deletion) to facilitate integration with external services.
- Refactor the robot initialization process to load robots into cache and start the dispatcher, improving the overall system setup.
- Update the delivery event structure to include additional metadata for better context during message handling.
- Enhance logging capabilities for better observability during robot execution and event processing.
2026-03-01 22:03:25 +08:00

22 lines
472 B
Go

package telegram
import (
"testing"
)
func TestNewBot(t *testing.T) {
b := NewBot("123:ABC", "my-secret")
if b.Token() != "123:ABC" {
t.Fatalf("expected token 123:ABC, got %s", b.Token())
}
if b.SecretToken() != "my-secret" {
t.Fatalf("expected secret my-secret, got %s", b.SecretToken())
}
}
func TestNewBot_EmptySecret(t *testing.T) {
b := NewBot("123:ABC", "")
if b.SecretToken() != "" {
t.Fatalf("expected empty secret, got %s", b.SecretToken())
}
}