I'm kinda new to bot developing, but I've made a command called &pat and I want it to work like this:
You do &pat @user and I want it to respond like this: @user-executing-the-command, you have successfully patted @user-mentioned-in-the-command. I've come up with this code so far and it works all well apart from pinging the patted person. I does ping them, but it shows @invalid-user, and idk how to fix that. My code:
var pattedone = message.mentions.members.first();
if(!pattedone) return message.reply('please mention the one who should be patted');
message.reply(`you have successfully patted ${pattedone}`);
Do you know how to fix that @invalid-user thing? Thanks. Here is screenshot of the bot's response