Esta es una idea de código que tenía para crear un código que se active al mencionar a un determinado usuario y advertir al usuario activado, pero simplemente no funciona.
const Client = require("./Structures/Client.js"); const config = require("./Data/config.json"); const client = new Client(); client.on("messageCreate", message => { if(message.content == "<@USER2ID>") message.reply("User1#1234 has mentioned User2#1234"); }); client.start(config.token);Debería usar el objeto message.mentions en lugar de obtener el contenido del mensaje. También es client.start no es una función. Debería usar la función client.login en su lugar. También se olvidó de mencionar las intenciones que desea utilizar. Por favor, eche un vistazo al siguiente ejemplo:
const {Client, Intents} = require('discord.js'); // Import the client and intents const config = require('./Data/config.json'); // Import the config const client = new Client({ intents: [Intents.FLAGS.GUILD_MESSAGES] // Uses the intent 'GUILD_MESSAGES' to be able to get the messages }); // Creates the client client.on('messageCreate', message => { // Creates an event listener if(message.author.bot || message.channel.type === `DM`) return; // Returns when the author is a bot or if the message is being send in a DM if(message.mentions.members.get(`0123456789`)){ // If the user with the user id '0123456789' has been mentioned in the message message.reply(`The user ${message.mentions.members.get(`0123456789`).user.tag} has been mentioned`); // Sends the reply } }); client.login(config.token); // Login to the bot