Skip to content

Name the handle, and say at boot which badges have no emoji - #2

Merged
maersux merged 1 commit into
mainfrom
feat/translator-emoji-and-handles
Aug 26, 2026
Merged

maersux merged 1 commit into
mainfrom
feat/translator-emoji-and-handles

Conversation

@maersux

@maersux maersux commented Aug 26, 2026

Copy link
Copy Markdown
Member

Three things, and the middle one is why the first was needed.

The translator emoji. BADGE_EMOJI had eight entries and the api now sends nine. A row falls back to plain names unless every badge on it has an emoji, so the first person granted the badge would have lost their whole row — donator emoji included. Nobody held it yet, so nothing was broken; it was waiting.

The test that should have caught it was the problem. It read "carries an id for every badge, so a row never falls back for one missing entry" and checked against a hardcoded list of eight — a third copy of a list the api owns. Map, list and test agreed and were wrong together. A test cannot ask production, so the completeness check moved to boot: the bot asks /v1/badges once and names what it cannot draw. Verified against the live api — it printed no emoji for translator before the id went in, and badge emoji cover all 9 badges after.

The join and boost lines name the handle. Kyelin / just joined the server! becomes Kyelin / **kyelin** just joined the server! — the author line keeps the display name, the line under it says who that is, which is the part that survives a rename.

The description is markdown and the author line is not, which this repo already had a test for. A discord username may hold _, so some_user_name would have arrived with its middle in italics and the underscores eaten. Escaped, with a test.

64 tests green, prettier clean.

Note for the deploy: DISCORD_BADGE_ROLES on the server needs ,translator:1542117530553032755 appended for the badge to grant the role. No code change — /v1/internal/badges/discord is generic and already returns translator holders.

@maersux
maersux merged commit 40f862b into main Aug 26, 2026
4 checks passed
@maersux
maersux deleted the feat/translator-emoji-and-handles branch August 26, 2026 11:25
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.

1 participant