Discord.js send emoji

Viewed 29772

I'm trying to make my bot send an emoji whenever I Type =emoji

I've managed to get everything done but I have no idea how to make the bot send an emoji by the ID of the emoji.

Any help would be appreciated!

4 Answers

Do you know the name of the emoji? if so, you can simply do this:

message.channel.send("<:emoji name:emoji id>")

If not, you could possibly do,

const emoji = bot.emojis.cache.get("emoji id")

message.channel.send(`${emoji}`)

I assume the emoji has to be cached for the method above to work, i'm sure someone else could brew up a better solution.

Hope i could help!

For an animated emoji use <a:EmojiName:EmojiID>

If you don't have Nitro to check the emoji's ID check the guide here

You can use

message.channel.send(":emoji name:emoji id")

For if you know the name or the emoji you want

Apparently the format has been changed now.

I was able to get it using message.channel.send("Hey! :smiley:") Just like that!

Related