I want to create a discord bot which react specific user message

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

@Yashraj

if (message.author.id === "USER ID HERE") {
   message.react('EMOJI HERE like 😄');
}
1 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

@Yashraj

const emoji = message.guild.emojis.cache.find(emoji => emoji.name === 'EMOJI NAME');
message.react(emoji);
1 Like

It won’t work Its says error

It says message undefined @khalby786

@random can you help me plzz

@Yashraj,

Can see the part of the code where you are trying to do the reacting commands?

1 Like


@khalby786 Here

In server.js I want to put there

Problem is in log message undefined @khalby786

  1. Your bot token is public, I suggest you regenerate it or else someone can get control of your bot.

  2. 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 first client.on("message") event.

2 Likes


@khalby786 its says this in logs continued

@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 :slight_smile:

1 Like

Ty both of you tysm for nake it possible

1 Like

@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);
}
1 Like