I want to create a discord bot which react specific user message like only given user id.
plzz any on help me witch codding i make code but that won’t working
need urgent help plzz anyone
if (message.author.id === "USER ID HERE") {
message.react('EMOJI HERE like 😄');
}
I would highly suggest reading the documentation
@khalby786 yeahh it works but i need to do animated emoji i put emoji name but it cant react
const emoji = message.guild.emojis.cache.find(emoji => emoji.name === 'EMOJI NAME');
message.react(emoji);
It won’t work Its says error
It says message undefined @khalby786
@random can you help me plzz
Can see the part of the code where you are trying to do the reacting commands?
In server.js I want to put there
Problem is in log message undefined @khalby786
-
Your bot token is public, I suggest you regenerate it or else someone can get control of your bot.
-
You are using two message events and only one is needed. You can remove the second
client.on("message")
and place the code I gave above in the firstclient.on("message")
event.
@EddiesTech can you help with this thing
Hi @Yashraj!
Having looked at Google, it seems you don’t need to have cache in there.
So like this:
const emoji = message.guild.emojis.find(emoji => emoji.name === 'emoji_64')
If this answer fixed your issue, please click the ‘Solution’ button below the post
Ty both of you tysm for nake it possible
@EddiesTech Its work but it react everyone message i want to do only mine message
Move the
message.react(emoji);
into the if statement you have like so:
if(message.author.id === 'id'){
message.react(emoji);
}