-
-
Notifications
You must be signed in to change notification settings - Fork 71
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 emoji argument #349
Conversation
5fc4e1f
to
0f97dac
Compare
This should be merged alongside sapphiredev/framework#349
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.
Maybe you should add a test for this resolver, it seems pretty easy.
With the following test cases: 😄
, :smile:
, smile
, <:custom:737141877803057244>
, <a:custom:737141877803057244>
etc
src/lib/resolvers/emoji.ts
Outdated
const emojiId = EmojiRegex.exec(parameter)?.groups?.id; | ||
|
||
if (emojiId) { | ||
const resolved = Util.parseEmoji(emojiId) as EmojiObject; | ||
|
||
if (resolved) { | ||
return ok(resolved); | ||
} | ||
} |
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.
This is always going to return false
for animated
as per how parseEmoji
works: https://github.com/discordjs/discord.js/blob/12ffa069aa8b247e945fef16a543f41c2c391bf1/packages/discord.js/src/util/Util.js#L284-L298
Instead pass the full parameter into the method.
c9d9892
to
924558b
Compare
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.
LGTM after this one thing
This should be merged alongside sapphiredev/framework#349
With this addition there will be a built-in argument for both global and guild emojis