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
I would highly suggest reading the documentation
const emoji = message.guild.emojis.cache.find(emoji => emoji.name === 'EMOJI NAME');
message.react(emoji);
1 Like
It won’t work Its says error
In server.js I want to put there
-
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.
2 Likes
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
1 Like
Ty both of you tysm for nake it possible
1 Like
Move the
message.react(emoji);
into the if statement you have like so:
if(message.author.id === 'id'){
message.react(emoji);
}
1 Like