- Introduce Discord adapter in the robot lifecycle to enable integration with Discord events. - Update the integration dispatcher to recognize and handle events from Discord. - Modify the configuration structure to include settings for Discord integration. - Enhance the integration parsing logic to support Discord configurations.
27 lines
588 B
Go
27 lines
588 B
Go
package discord
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// TestE2E_01_BotUser verifies the Discord bot token by fetching bot user info.
|
|
func TestE2E_01_BotUser(t *testing.T) {
|
|
skipIfNoToken(t)
|
|
bot := testBot(t)
|
|
|
|
user, err := bot.BotUser()
|
|
if err != nil {
|
|
t.Fatalf("BotUser: %v", err)
|
|
}
|
|
if user.ID == "" {
|
|
t.Error("user.ID should not be empty")
|
|
}
|
|
if user.Username == "" {
|
|
t.Error("user.Username should not be empty")
|
|
}
|
|
if !user.Bot {
|
|
t.Error("user.Bot should be true")
|
|
}
|
|
t.Logf("OK id=%s username=%s discriminator=%s bot=%v",
|
|
user.ID, user.Username, user.Discriminator, user.Bot)
|
|
}
|