Skip to content

Never ping admins for their own asay; trust the game's staff count - #99

Merged
valzargaming merged 1 commit into
mainfrom
claude/project-thread-pi4ke1
Nov 13, 2026
Merged

valzargaming merged 1 commit into
mainfrom
claude/project-thread-pi4ke1

Conversation

@valzargaming

Copy link
Copy Markdown
Member

Requested by Val · project thread

Val was pinged for asay lines Val sent in game as an online admin. handleStaffWebhook pinged @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:

  • New HttpServiceManager::staffWebhookNeedsPing(): no ping when the game marks the line from_staff or kind asay, or (older games) the message has the (map) ASAY: marker; uses the game's staff_online count when present; otherwise falls back to the Discord presence check.
  • The fallback compares ckeys case-insensitively.
  • Companion game PR adds the kind, from_staff and staff_online fields (Civ13/Civ13).

Tests: php tests/local/ooc-webhook.php vendor/autoload.php passes; the new checks fail without the fix ("Admin was pinged for their own staff line"). All other tests/local scripts pass except the three helper workers that always exit non-zero when run bare.


Generated by Claude Code

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
Copilot AI balanced review requested due to automatic review settings November 13, 2026 23:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@valzargaming
valzargaming merged commit c635dc3 into main Nov 13, 2026
41 of 44 checks passed
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants