【发布时间】:2020-12-25 06:54:09
【问题描述】:
我刚刚开始创建我的 discord 机器人,我想发出警告命令,但我只希望具有主持人角色的人能够使用它。有没有办法检查用户是否具有特定角色?谢谢。到目前为止我的代码:
module.exports = {
name: 'warn',
description: "The bot will warn the mentioned user",
execute(message, args){
var warnedone = message.mentions.first()
if(author doesnt have a role with ID 712229762742878321) {
return message.reply('can not use this command')
}
}
}
【问题讨论】:
标签: javascript discord.js