mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-10-04 00:13:30 +00:00
/genshin takes the same input as /gacha and sends the Genshin-style meteor wish that wheelofnames serves on /api/genshin, as a 7-second 640x360 MP4. It stays out of the command menu and /help.
36 lines
926 B
Go
36 lines
926 B
Go
package random
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/tiennm99/miti99bot/internal/modules"
|
|
"github.com/tiennm99/miti99bot/internal/storage"
|
|
)
|
|
|
|
func TestNew_RegistersRandomGroup(t *testing.T) {
|
|
mod := New(modules.Deps{Store: storage.NewMemoryProvider().Collection("random")})
|
|
|
|
want := map[string]modules.Visibility{
|
|
"random": modules.VisibilityPublic,
|
|
"wheelofnames": modules.VisibilityPublic,
|
|
"gacha": modules.VisibilityPublic,
|
|
"genshin": modules.VisibilityUnlisted,
|
|
}
|
|
if len(mod.Commands) != len(want) {
|
|
t.Fatalf("commands count = %d, want %d", len(mod.Commands), len(want))
|
|
}
|
|
for _, c := range mod.Commands {
|
|
v, ok := want[c.Name]
|
|
if !ok {
|
|
t.Errorf("unexpected command %q", c.Name)
|
|
continue
|
|
}
|
|
if c.Visibility != v {
|
|
t.Errorf("command %q visibility = %d, want %d", c.Name, c.Visibility, v)
|
|
}
|
|
if c.Handler == nil {
|
|
t.Errorf("command %q has nil handler", c.Name)
|
|
}
|
|
}
|
|
}
|