generated from alex/base-template
Prevent bot to print horse fact at boot #15
Labels
No labels
dependencies
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
alex/irc-greeter-bot#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We don't need to print at every reboot, a lossy daily reminder is all we need
/pi new PR
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
handleBotJoinincreateClient:Now update the test file — remove thehandleBotJoinimport and its tests:Let me check for now-unused variables in the test file (likechannelwhich was only used by removed tests):Thechannelconstant is still used by thejoinhelper. 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'sfallowcheck to ensure nothing else broke:Formatting needs a fix. Let me applydeno fmtand 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
handleBotJoinfunction (and itsHandleBotJoinResulttype) along with its invocation in thejoinevent handler — that's what fired once per channel each time the bot connected. The daily local-midnight broadcast viastartDailyMidnight/broadcastFactis 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)