fix(emoji): render a standard emoji for the reaction endpoints - #15
Merged
Merged
Conversation
EmojiBuilder rendered a standard emoji held under name as "✅:" — the name, a colon, and an id that was not there — which made every reaction on a standard emoji a malformed request, with an undefined array key warning on the way out. Standard emoji arrive under name, since that is where Discord puts them in a reaction event and therefore what fromPart() copies across. They were only ever rendered correctly when written by hand into setId(), which is the shape the existing test used and the reason this held. Both keys now work, and the pair is what marks a custom emoji.
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 2, 2026
## [1.3.2](v1.3.1...v1.3.2) (2026-09-02) ### Bug Fixes * **emoji:** render a standard emoji for the reaction endpoints ([#15](#15)) ([c57b1d5](c57b1d5))
|
🎉 This PR is included in version 1.3.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
EmojiBuilder::__toString()renders a standard emoji held undernameas:— the name, a colon, and an id that is not there. Every reaction on a standard emoji is a malformed request, and PHP warns about the undefined key on the way out.
The two halves of the library disagree about where a standard emoji lives.
fromPart()copiesnameand skipsid, because that is what Discord sends in a reaction event — so a builder made from a real event is exactly the case that cannot be rendered. The existing test wrote the emoji intosetId()instead, which takes the other branch, which is why this held.Both shapes work now, and the pair is what marks a custom emoji:
nameidapex12345apex:12345✅%E2%9C%85✅%E2%9C%85Found while porting a bot that votes on petitions with ✅ and ❌ reactions.
🤖 Generated with Claude Code