【发布时间】:2020-09-15 22:40:17
【问题描述】:
我正在使用 discord.js 制作一个不和谐的机器人,情况是我有一个从聊天中删除消息的命令,但它们只能由拥有 MANAGE_MESSAGES 权限的人使用,这个命令可以完美运行但是什么我不明白这是因为当它检测到此人没有权限时,它不会发送该人没有MANAGE_MESSAGES 权限的消息。感谢您的帮助。
case 'delete':
if (!args[1]) return message.reply('Please enter a number of messages you would like to delete like ``k!delete 5``. LIMIT: 100 MESSAGES');
message.channel.bulkDelete(args[1]);
if (!message.member.hasPermission('MANAGE_MESSAGES'))
return message.channel.send('You dont have the permission `MANAGE_MESSAGES` to use this command!!');
break;
【问题讨论】:
标签: bots discord discord.js