Repository navigation
Never ping admins for their own asay; trust the game's staff count - #99
Merged
Merged
Conversation
handleStaffWebhook now skips the @Admin ping when the game marks the line as staff-written (from_staff, kind asay, or the legacy ASAY text marker) and uses the game's staff_online count when present. The Discord presence fallback compares ckeys case-insensitively. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WTP2Qv2xYW4A5Nhf9omgP
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Val · project thread
Val was pinged for asay lines Val sent in game as an online admin.
handleStaffWebhookpinged @Admin whenever it could not match a Discord member with the Admin role, through the verified list, to the server's player list. That guess fails for many reasons (member cache, verified ckey, stale heartbeat, shards), and it ran even for asay, which only staff can send.Changes:
HttpServiceManager::staffWebhookNeedsPing(): no ping when the game marks the linefrom_stafforkindasay, or (older games) the message has the(map) ASAY:marker; uses the game'sstaff_onlinecount when present; otherwise falls back to the Discord presence check.kind,from_staffandstaff_onlinefields (Civ13/Civ13).Tests:
php tests/local/ooc-webhook.php vendor/autoload.phppasses; the new checks fail without the fix ("Admin was pinged for their own staff line"). All othertests/localscripts pass except the three helper workers that always exit non-zero when run bare.Generated by Claude Code