mirror of
https://github.com/kuhyx/signal-bot.git
synced 2026-11-11 13:07:51 +01:00
!staty, !wczoraj, !tydzień, !miesiąc, !rok, !rekordy, !korona, !dni and !ja, under 29 triggers with both Polish spellings of each. None takes an argument. registry.resolve matches the whole folded body against a trigger, so "!ja ala" resolves to nothing; teaching it to split on whitespace would silently make "!kot pls" fire where today it does nothing. Each question gets its own trigger instead. !wczoraj renders through the same code path as the nightly post, which is not a convenience: the bot cannot trigger its own 21:37 report, so without byte-identical output there is no way to check the headline feature of this release short of waiting for the evening. Two guards worth naming: - test_every_trigger_is_unique builds the whole registry. DuplicateTriggerError subclasses ValueError, and ValueError is in startup_retry.RETRYABLE -- so a colliding alias would not crash the bot, it would retry forever logging "signal-cli not reachable yet". Checked at test time instead of never. - No trigger may contain a digit: fold() maps 0134578 onto letters, so "!7dni" would resolve as "!tdni". Also asserted. Every command answers on an empty history rather than crashing, which is the state the group will actually be in for the next few days: records, the crown and the weekday table all say "za mało danych" because their only day so far is the backfilled one, and they exclude it. Verified against a copy of the live database -- all nine render correctly on the real group's data. One test bug caught while writing it: it seeded "today" and excluded 2026-08-30, which on the day it was written were the same date, so it passed for the wrong reason. Fixed dates now. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015d48t4qsQLBJnDwDeo2Nom
88 lines
1.3 KiB
JSON
88 lines
1.3 KiB
JSON
{
|
||
"_comment": "Command trigger words, including the styled Unicode variants people actually type. These live as data, not source, because they are data: adding an alias should never mean touching Python.",
|
||
"cat": [
|
||
"!kot",
|
||
"!koty",
|
||
"!kots",
|
||
"!cat",
|
||
"!cats",
|
||
"!meow",
|
||
"!miau",
|
||
"!ᴋᴏᴛ",
|
||
"!𝓴𝓸𝓽",
|
||
"!𝗸𝗼𝘁"
|
||
],
|
||
"dog": [
|
||
"!pies",
|
||
"!psy",
|
||
"!dog",
|
||
"!dogs",
|
||
"!woof",
|
||
"!szczek",
|
||
"!𝗽𝗶𝗲𝘀",
|
||
"!͓̽p͓̽i͓̽e͓̽s͓̽"
|
||
],
|
||
"gecko": [
|
||
"!gekon",
|
||
"!gekony",
|
||
"!geko",
|
||
"!gecko",
|
||
"!geckon",
|
||
"!geckos"
|
||
],
|
||
"pope": [
|
||
"!papież",
|
||
"!papiez",
|
||
"!papieze",
|
||
"!papieża",
|
||
"!papa",
|
||
"!pope",
|
||
"!popes",
|
||
"!pontifex",
|
||
"!𝗽𝗮𝗽𝗶𝗲𝘇"
|
||
],
|
||
"stats_today": [
|
||
"!staty",
|
||
"!statystyki",
|
||
"!stats",
|
||
"!dziś",
|
||
"!dzis"
|
||
],
|
||
"stats_yesterday": [
|
||
"!wczoraj",
|
||
"!yesterday"
|
||
],
|
||
"stats_week": [
|
||
"!tydzień",
|
||
"!tydzien",
|
||
"!week"
|
||
],
|
||
"stats_month": [
|
||
"!miesiąc",
|
||
"!miesiac",
|
||
"!month"
|
||
],
|
||
"stats_year": [
|
||
"!rok",
|
||
"!year"
|
||
],
|
||
"stats_records": [
|
||
"!rekordy",
|
||
"!rekord",
|
||
"!records"
|
||
],
|
||
"stats_crown": [
|
||
"!korona",
|
||
"!crown"
|
||
],
|
||
"stats_weekdays": [
|
||
"!dni",
|
||
"!days"
|
||
],
|
||
"stats_me": [
|
||
"!ja",
|
||
"!moje",
|
||
"!mnie"
|
||
]
|
||
}
|