![](/img/trans.png)
[英]How can I add a javascript alert message if checkbox is checked more than one?
[英]How Can i Add More Then One Permission In This?
我想要一个命令比MANAGE_MESSAGES
多一个权限
我该怎么做?
我的代码:
if(!message.member.hasPermission(["MANAGE_MESSAGES"]))
GuildMember.hasPermission()
接受PermissionResolvable
作为第一个参数,它可以是一个Array
。
if (message.member.hasPermission(["MANAGE_MESSAGES", "BAN_MEMBERS", "CONNECT"])) {
// Code Here
};
.hasPermission([parameter]) is an Array, so you can name more than one parameter,
if(message.member.hasPermission(['MANAGE_MESSAGES', 'KICK_MEMBERS', 'ETC']) {
/* Code */
}
或者你可以做
if(!message.member.hasPermission(['MANAGE_MESSAGES', 'KICK_MEMBERS', 'ETC']) return;
/* this is for the members who dont have the permissions, ignore, if you want you can
add things to return, ex:*/
return message.channel.send('No permissions');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.