I am looking to create a command in order to tag certain users.
This is what I have tried:
var players = [
"@RYAN#9602"
]
switch(args[0].toLowerCase()){
case "play":
message.channel.send(players.join('\n'));
break;
}
However, it just sends a message into the text channel without actually tagging the user.
In summmary, I am looking to be able to tag a user through a discord.js bot.
Any help would be greatly appreciated, thanks!
You have two options.
You can either use the
toString
method on the User object, or form the mention yourself using the user's ID.Here's an example using toString:
And here's an example using the ID