Lord Reptilia
Lord Reptilia

Reputation: 700

Why my bot isn't pinging the user when mentioned in v13?

I'm sending a message and it shows up in the channel, but I don't get the red ping notification even though I'm being mentioned. This is my code

await message.guild["channels"].cache
  .get(<SOME_ID>)
  .send({
    allowedMentions: { repliedUser: true },
    content: `Welcome <@${message.author.id}> this is your channel`
  });

Why wouldn't I get notified?

Upvotes: 0

Views: 324

Answers (1)

Lord Reptilia
Lord Reptilia

Reputation: 700

Just had to add allowedMentions: { users: [message.author.id]}

The final code would be:

await message.guild["channels"].cache
  .get(<SOME_ID>)
  .send({
    allowedMentions: { users: [message.author.id], repliedUser: true },
    content: `Welcome <@${message.author.id}> this is your channel`
  });

This pings the given user.

Upvotes: 1

Related Questions