fix: handle !leader with no space before custom emoji#59
Merged
Conversation
Discord.js Collection iterates as [id, Message] pairs, not bare Messages. Passing .values() gives replaceFirstMessage the Message objects it expects. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ing, proxyAuthors leak - config.js: trim whitespace from SearchPhrasesToBlock entries so that 'bad, word' in the env var does not create a ' word' entry that silently bypasses the block - replacer.js: apply normalizeUnicode to the replacement text before the blocked-phrase check, closing the curly-quote bypass - scoring.js: guard parseScoreLine against bare '++' / '--' lines that would insert an empty-string phrase into the DB - reactions.js: cap proxyAuthors Map at 1000 entries (FIFO eviction) to prevent unbounded growth over long uptime Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lents Adds U+201B and U+02BC to the Unicode normalizer so that modifier-letter apostrophes (and other device-specific single-quote substitutions) match regular apostrophes in searches and scored phrases. Applies normalizeUnicode to phrase storage and lookup in scoring so that smart apostrophes and em dashes typed in scored phrases are interchangeable across devices. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Slicing by '!leader ' (with space) consumed the leading '<' of a custom emoji when typed without a space, producing ':name:id>' as the body instead of '<:name:id>'. The regex didn't match, key and display were wrong, and the Easter-egg zero-results message echoed the broken entity literally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Slicing by '!leader ' (with space) consumed the leading '<' of a custom emoji when typed without a space, producing ':name:id>' as the body instead of '<:name:id>'. The regex didn't match, key and display were wrong, and the Easter-egg zero-results message echoed the broken entity literally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zippy1981
requested changes
May 5, 2026
| // of the command issuer. | ||
| // Capped at 1000 entries (FIFO) — the oldest entry is evicted when the cap is | ||
| // hit, since stale proxy mappings for long-past messages are never useful. | ||
| const PROXY_AUTHORS_MAX = 1000; |
zippy1981
approved these changes
May 12, 2026
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.
Summary
parseLeaderCommandsliced'!leader '.length(8 chars), which consumed the leading<of a custom emoji when typed without a space — e.g.!leader<:umami:id>produced body:umami:id>instead of<:umami:id>. The regex didn't match, so key and display were wrong, and the Easter-egg zero-results message echoed the broken entity literally.'!leader'.length(7 chars) and let the existing.trim()handle any leading space.Test plan
parseLeaderCommand('!leader<:kirby:123456789>')test — now returns correct key and display🤖 Generated with Claude Code