0
votes

I am now making a discord bot and want to make a poke command. The user can poke another member. I know how to mention the author but I cannot seem to mention the user. EXAMPLE: '!poke [user given by the author]'.

How do I make my bot mention that user?

1

1 Answers

1
votes

You can use user.toString(). For example:

bot.on("message", (message) => {

    if(message.content.startsWith("poke")){
        let userToMention = message.mentions.users.first();
        message.channel.send("Mention: "+userToMention.toString());
    }

});

If you write !poke @user, the bot will reply with Mention: @user.