Prevent bot to print horse fact at boot #15

Closed
opened 2026-07-27 03:42:38 +00:00 by alex · 2 comments
Owner

We don't need to print at every reboot, a lossy daily reminder is all we need

We don't need to print at every reboot, a lossy daily reminder is all we need
Author
Owner

/pi new PR

/pi new PR
Contributor

Now I understand the codebase. The horse fact is printed on every boot via handleBotJoin (called when the bot itself joins a channel), and also on every reconnect. The daily midnight scheduler (startDailyMidnight + broadcastFact) already provides the "lossy daily reminder." I'll remove the boot-time fact while keeping the daily reminder.

Let me make the changes:Now remove the call to handleBotJoin in createClient:Now update the test file — remove the handleBotJoin import and its tests:Let me check for now-unused variables in the test file (like channel which was only used by removed tests):The channel constant is still used by the join helper. Now let me run the type check, linter, and tests:Type check and lint pass. Now run the tests:All tests pass. Let me run the full suite and the project's fallow check to ensure nothing else broke:Formatting needs a fix. Let me apply deno fmt and re-verify:Everything passes. Let me review the final diff:The diff is clean. Let me quickly check the README to see if it documents the boot-time fact behavior that should be updated:The README documents the on-join behavior. I'll update it to reflect that only the daily midnight fact remains:All checks pass. Now let me create the PR:PR #16 created.

The bot no longer posts a horse fact on every boot/reconnect. I removed the handleBotJoin function (and its HandleBotJoinResult type) along with its invocation in the join event handler — that's what fired once per channel each time the bot connected. The daily local-midnight broadcast via startDailyMidnight / broadcastFact is left untouched, since that's the "lossy daily reminder" you want to keep. Tests, README, lint, and dead-code checks were all updated and pass.


View action run | Model: zai/glm-5.2 (thinking: max) | Time: 4m 12s | Tokens: 362.4K | Pi SDK v0.81.1 | Action v2.26.0-develop (develop @ 4387e26)

Now I understand the codebase. The horse fact is printed on every boot via `handleBotJoin` (called when the bot itself joins a channel), and also on every reconnect. The daily midnight scheduler (`startDailyMidnight` + `broadcastFact`) already provides the "lossy daily reminder." I'll remove the boot-time fact while keeping the daily reminder. Let me make the changes:Now remove the call to `handleBotJoin` in `createClient`:Now update the test file — remove the `handleBotJoin` import and its tests:Let me check for now-unused variables in the test file (like `channel` which was only used by removed tests):The `channel` constant is still used by the `join` helper. Now let me run the type check, linter, and tests:Type check and lint pass. Now run the tests:All tests pass. Let me run the full suite and the project's `fallow` check to ensure nothing else broke:Formatting needs a fix. Let me apply `deno fmt` and re-verify:Everything passes. Let me review the final diff:The diff is clean. Let me quickly check the README to see if it documents the boot-time fact behavior that should be updated:The README documents the on-join behavior. I'll update it to reflect that only the daily midnight fact remains:All checks pass. Now let me create the PR:PR [#16](https://forge.l3x.in/alex/irc-greeter-bot/pulls/16) created. The bot no longer posts a horse fact on every boot/reconnect. I removed the `handleBotJoin` function (and its `HandleBotJoinResult` type) along with its invocation in the `join` event handler — that's what fired once per channel each time the bot connected. The daily local-midnight broadcast via `startDailyMidnight` / `broadcastFact` is left untouched, since that's the "lossy daily reminder" you want to keep. Tests, README, lint, and dead-code checks were all updated and pass. --- [View action run](https://forge.l3x.in/alex/irc-greeter-bot/actions/runs/67) | Model: zai/glm-5.2 (thinking: max) | Time: 4m 12s | Tokens: 362.4K | Pi SDK v0.81.1 | Action v2.26.0-develop (develop @ 4387e26)
alex closed this issue 2026-07-27 03:52:55 +00:00
Sign in to join this conversation.
No labels
dependencies
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alex/irc-greeter-bot#15
No description provided.