Clarify cleanup rule bot commands

This commit is contained in:
ShukeBta
2026-06-16 02:47:00 +08:00
parent a9b85c0f3f
commit 833966afb2
8 changed files with 41 additions and 29 deletions
+8 -2
View File
@@ -171,8 +171,9 @@ func TestTelegramCommandMenusSeparateGroupAndAdminCommands(t *testing.T) {
t.Fatalf("group menu should include %s", required)
}
}
adminNames := telegramCommandNames(telegramAdminBotCommandMenu())
for _, required := range []string{"users", "status", "cleanup_rule"} {
adminCommands := telegramAdminBotCommandMenu()
adminNames := telegramCommandNames(adminCommands)
for _, required := range []string{"users", "status", "cleanup_mode", "cleanup_rule"} {
if !adminNames[required] {
t.Fatalf("admin menu should include %s", required)
}
@@ -182,6 +183,11 @@ func TestTelegramCommandMenusSeparateGroupAndAdminCommands(t *testing.T) {
t.Fatalf("admin menu should hide compatibility alias %s", hiddenAlias)
}
}
for _, command := range adminCommands {
if strings.Contains(command.Description, "Sakura") {
t.Fatalf("admin menu command %s should not mention Sakura: %q", command.Command, command.Description)
}
}
}
func telegramCommandNames(commands []telegramBotCommand) map[string]bool {