Discord Bot Mentioning

Cedric Wong picture Cedric Wong · May 27, 2018 · Viewed 8.6k times · Source

I am trying to make my bot send a ping to me when someone types !owner, however, the bot only sends my userID or name unlinked. How do I make it into a ping? I am using NodeJS for this bot.

const Discord = require('Discord.js');
const bot = new Discord.Client();

bot.on('message', (message) => {
    if(message.content == '!owner') {
        message.channel.send('Hi @"userID" is the owner, do you need help');
    }
});

bot.login('BotToken')

Answer

Mane picture Mane · May 27, 2018

Replace @"userID" with <@your_user_id_here>.
For example: <@123456789123456789>