feat(help): split /help into several messages past Telegram's length limit

This commit is contained in:
tiennm99 committed 2026-10-01 10:28:09 +07:00
1 parent 7cc0ead54f
commit 4607ae5f14
4 files changed
+111 -25

No files matched your search

+4 -3
View File
@@ -138,9 +138,10 @@ func TestCommandDiscovery_AllPublicCommandsHaveSafeMetadata(t *testing.T) {
}
}
help := moduleutil.RenderHelp(reg)
if utf8.RuneCountInString(help) > telegramMessageMaxRunesForTest {
t.Fatalf("/help source is %d characters, exceeds conservative Telegram limit %d", utf8.RuneCountInString(help), telegramMessageMaxRunesForTest)
for i, help := range moduleutil.RenderHelpMessages(reg) {
if utf8.RuneCountInString(help) > telegramMessageMaxRunesForTest {
t.Fatalf("/help message %d source is %d characters, exceeds conservative Telegram limit %d", i+1, utf8.RuneCountInString(help), telegramMessageMaxRunesForTest)
}
}
}