Skip to content
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

fix(Components): support emoji id strings #8310

Merged
merged 1 commit into from Jul 19, 2022
Merged

Conversation

advaith1
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:

Currently passing an emoji string to emoji in components fails in v14 because it puts the id in name instead of id. Using resolvePartialEmoji instead of parseEmoji fixes this, doing the v13 behavior and sending the message correctly.

I thought this was already fixed but turns out it was not.

Example code that works after this change and on v13, but not on v14.0.2:

message.channel.send({
    components: [{
        type: Discord.ComponentType.ActionRow,
        components: [
            {
                type: Discord.ComponentType.Button,
                style: 1,
                customId: 'test',
                label: 'test',
                emoji: '851461487498493952'
            }
        ]   
    }]
})

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@vercel
Copy link

vercel bot commented Jul 18, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
discord-js ⬜️ Ignored (Inspect) Jul 18, 2022 at 0:48AM (UTC)

@Jiralite Jiralite added this to the discord.js v14.1 milestone Jul 18, 2022
@advaith1 advaith1 changed the title fix(discord.js): support emoji id strings in components fix(Components): support emoji id strings Jul 18, 2022
@iCrawl iCrawl merged commit 660e212 into discordjs:main Jul 19, 2022
@advaith1 advaith1 deleted the emoji-ids branch September 11, 2022 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants