标签: node.js discord discord.js bots
Attached below is a part of my code. What it does is that if I type "pain.throw @user" it will throw out an embed and some text. However, if I don't mention a user, my code doesn't work. Is there a way someone can show me to let the bot spit out a message and say "You have to mention someone for this to work" or something. Thank you. Any help is appreciated.
答案 0 :(得分:0)
只需添加一个
if (!usernamegedUser) return message.channel.send("Try again, except mention someone");
在
const usernamegedUser = message.mentions.users.first();