Skip to content

feat: !leader uses server display names, no longer pings#62

Merged
badLlama121 merged 1 commit into
mainfrom
feat/leader-display-names
Jun 1, 2026
Merged

feat: !leader uses server display names, no longer pings#62
badLlama121 merged 1 commit into
mainfrom
feat/leader-display-names

Conversation

@davelindsay84

Copy link
Copy Markdown
Collaborator

What

!leader now renders each ranked user's server display name (nickname → global display name → username) as plain text, instead of embedding <@id> mention tokens.

Why

The old format embedded <@id> mentions, which pinged every listed user every time the command ran. This makes the leaderboard quiet.

How

  • reactions.jsgetLeaderboard now takes a resolveName(userId) callback (sync or async) and is itself async.
  • index.js — the !leader handler resolves IDs via guild.members.fetch(id).displayName, falling back to "unknown user", and sends with allowedMentions: { parse: [] } as a safety belt against literal @everyone in a name.
  • Tests updated to pass an identity resolver and assert plain-text names with no mention syntax (22 passing).

🤖 Generated with Claude Code

Reactions leaderboard previously embedded `<@id>` mention tokens, which
ping the user every time the command runs. Render server display names
as plain text instead, and clamp allowedMentions so a name containing
literal "@everyone" can't ping either.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@badLlama121 badLlama121 self-requested a review June 1, 2026 20:07
@badLlama121 badLlama121 merged commit 7573a1a into main Jun 1, 2026
1 check passed
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.

2 participants