【发布时间】:2020-12-27 19:26:33
【问题描述】:
我想创建一个if 语句来检测消息作者是否具有名为System Control Authority - 50 的角色。如果是这样,他们就不能使用该命令。我该怎么做?
const sys10 = client.guilds.cache
.get('745816516238245888')
.roles.cache.find((role) => role.name === 'System Control Authority - 10');
if (cmd == 'aerial') {
message.delete({ timeout: 10 });
if (!sys10 && !devRole && !adminRole && !qgRole && !qgtsRole) {
return func.Loi(
'You cannot use this command.\nRequire role: **System Control Authority - 10**'
);
}
const takelinda = message.mentions.members.first().id;
if (takelinda == '669723732708687882') {
return func.Loi(message, 'You cannot use this command to me =)))');
}
return message.channel.send(
'*<@' +
message.author.id +
'>:*\nSystem Call.\nGenerate Aerial Element.\nBurst Element!\n*<@' +
takelinda +
'>: ahhhhh*\n*System: <@' +
takelinda +
'> has been defeated.*'
);
}
【问题讨论】:
标签: javascript node.js discord discord.js