【发布时间】:2019-06-18 23:02:55
【问题描述】:
我正在寻找开发个人网络机器人,我需要一个简单的“mod”、“admin”和其他审核命令。我已经完成了命令,我只需要弄清楚如何发送错误并在成员没有“admin”、“mod”或其他审核角色时不执行命令。这是我目前所拥有的:
if (!message.member.roles.some(r=>[Tester].includes(r.name)) )
return message.channel.send("error_here").catch(console.error);
我希望代码中包含错误消息:
message.channel.send(message.author + " you do not have permission to use this command!")
我还希望在成员不具有“admin”、“mod”或其他审核角色时不执行命令。
【问题讨论】:
标签: discord.js