-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add ApplicationEmoji to EmojiResolvable and MessageReaction#emoji #10477
Open
Moebits
wants to merge
8
commits into
discordjs:main
Choose a base branch
from
Moebits:application-emoji-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+21
−7
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ee1aa9c
types: add ApplicationEmoji to EmojiResolvable
Moebits 58d1f5f
typings: add ApplicationEmoji to MessageReaction#emoji
Moebits 95b4bab
removed ApplicationEmoji from MessageReaction
Moebits d27076c
update BaseGuildEmojiManager
Moebits d42f8da
chore: lint error
Moebits 6f25ce8
feat: add ApplicationEmoji to MessageReaction#emoji getter
Moebits 7f24d38
refactor: check application emojis first
Moebits c319602
Merge branch 'discordjs:main' into application-emoji-fix
Moebits File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In its current state, it is not possible for
MessageReaction#emoji
along with its associated private property to return an ApplicationEmoji, which would make these typings inaccurate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense for a MessageReaction done by the bot with an ApplicationEmoji to return ApplicationEmoji for its emoji property. Do you know where I can make these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since application emojis need to be fetched to be had, I wouldn't actually try to squeeze that in. it's fine to leave it as before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not add a cache check for ApplicationEmoji here?
discord.js/packages/discord.js/src/structures/MessageReaction.js
Lines 120 to 127 in 4594896
If it‘s not in cache the behavior would stay as is, if cached you‘d get the ApplicationEmoji.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof, that getter. I'd maybe add that logic into the getter to store app emojis if we really wanna go there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added
ApplicationEmoji
lookup to the getter.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That now changes the scope of the PR to not be types only. Please edit the PR title and description accordingly and make sure you actually tested that change.