Repository navigation
Name the handle, and say at boot which badges have no emoji - #2
Merged
Merged
Conversation
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.
Three things, and the middle one is why the first was needed.
The translator emoji.
BADGE_EMOJIhad 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/badgesonce and names what it cannot draw. Verified against the live api — it printedno emoji for translatorbefore the id went in, andbadge emoji cover all 9 badgesafter.The join and boost lines name the handle.
Kyelin / just joined the server!becomesKyelin / **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
_, sosome_user_namewould 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_ROLESon the server needs,translator:1542117530553032755appended for the badge to grant the role. No code change —/v1/internal/badges/discordis generic and already returns translator holders.