0

I'm trying to make the bot only send the embed message when mentioned with @, but it sends again when it's replied.

const mentionEmbed = new Discord.MessageEmbed()
    .setColor("#FF5733")
    .setTitle("Salve, Roberval na área ")
    .setDescription("Sou um bot dedicado ao envio de desenhos ASCII e copypastas utilizados em streams de qualidade duvidosa na plataforma roxa. \n \nPara me usar, basta utilizar o prefixo r! + o comando que você quiser!")
    .setFooter("All rights reserved @ Roberval - 2021", "https://i.imgur.com/BwCCYT9.jpg");

client.on("message", (message) => {
    if (message.author.bot) return false;

    if (message.content.includes("@here") || message.content.includes("@everyone")) return false;

    if (message.mentions.has(client.user.id)) {
        message.channel.send(mentionEmbed);
    }
});

Jakye
  • 6,440
  • 3
  • 19
  • 38
  • 1
    Does this answer your question? [Discord bot : How to know when a user is pinged in the message and not because it's a reply](https://stackoverflow.com/questions/68859319/discord-bot-how-to-know-when-a-user-is-pinged-in-the-message-and-not-because-i) – Jakye Aug 31 '21 at 18:28

2 Answers2

0

When you reply to a message, you can choose to mention the user (or not) and by default, it does.

You may want to check if the message is a reply with Message#type equals "REPLY" : https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=type

SkyleDc
  • 36
  • 4
0

Replying to a message mentions the author of the original message, that's why the bot sends the embed

You can check to see if the Message#type property is equal or not to "REPLY".

mvetois
  • 111
  • 11