Reputation: 1
So... I've started a while ago with Discord.JS, and I have been searching and searching, but I just can't really find how to react to message with "standard" Discord emojis. I mean...
https://i.sstatic.net/gLeHx.png - those emojis.
I want to do something like this:
execute(client, message, args) {
message.content.toLowerCase();
message.channel.send('Something...').then(resource => {
resource.react('${args}');
});
}
args = 842839246934114324 (:smile: emoji)
Upvotes: 0
Views: 2715
Reputation: 9
message.chanenl.send("hi").then(msg=>{
msg.react("ID")
// OR
msg.react("✅")
// OR
//V 11
let emoji = client.emojis.get("ID")
//V 12
let emoji= client.emojis.cache.get("ID")
if(emoji) return msg.react(emoji)
})
Upvotes: 0
Reputation: 2314
Get emoji by unicode symbol:
You need to copy the unicode symbols (copy them from discord or from a website like this one):
And then just say message.react('✅')
You can get the unicode emojis from discord by sending the emoji as you noramlly would and prepending \
before it. This will write the emoji as a unicode symbol which you can just copy into your code.
e.g.: instead of :laughing:
type \:laughing:
Get emoji by Id (only works with custom emojis):
const emoji = message.guild.emojis.resolve(id);
// OR
const emoji = client.emojis.resolve(id);
message.react(emoji);
Upvotes: 2
Reputation: 195
Adding onto MrCodingB's response:
Getting a native Unicode symbol from discord emojis is actually really easy; all you need to do is add an emoji and add a \
in front of it, then send the message :)
Although this is possible I personally use getemoji.com.
Upvotes: -1