Answer the question
In order to leave comments, you need to log in
How to get a Discord bot to mention you?
const Discord = require("discord.js");
const client = new Discord.Client();
client.login("my token");
client.on('message', (message) =>{
if(message.content == "!WO mine")
{
message.channel.send("m!mine");
}
});
client.on('message', (message) =>{
if(message.content == "!WO sell")
{
message.channel.send("m!sell all");
}
});
client.on('message', (message) =>{
if(message.content == "!WO trade")
{
message.channel.send("m!trade @Moinbox#8404");
but when I write !WO trade he just writes @Moinik#8404 without mentioning how to make him mention me
Answer the question
In order to leave comments, you need to log in
const Discord = require("discord.js");
const client = new Discord.Client();
client.login("мой токен");
client.on('message', (message) => {
if (message.content == "!WO trade") {
message.reply('message here');
}
});
In the example above, the answer should be:
and what without a comma, here's how you can:
another variation
or you can do it like this
:)
you can make an array,
const Discord = require("discord.js");
const client = new Discord.Client();
client.login("my token");
client.on('message', (message) => {
if (message.content == "!WO trade") {
let mtrade = message.author.username;
message.channel.send(`m!trade ${mtrade } `);
}
});
//mtrade array is just where you put the name, if you don't like it, change it, but replace it after let and in message.channel.send
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question