【问题标题】:Check if bot has a higher role than the role (Discord.js)检查 bot 的角色是否高于角色(Discord.js)
【发布时间】:2021-02-24 00:50:12
【问题描述】:

我正在做一个 giverole 命令,就像 !giverole {member} {role},但我怎么知道 bot 最高角色是否高于提到的角色。我还没有尝试任何东西,因为我被卡住了,请帮助我。

我正在使用 discord.js v12

【问题讨论】:

标签: javascript node.js discord discord.js bots


【解决方案1】:

我不知道您的代码是什么样子,但检查角色是否高于机器人的一种简单方法是查看角色是否可以被机器人编辑! if(!role.editable) return message.channel.send(":x: **I do not have the permission to use this command!**");

【讨论】:

    猜你喜欢
    • 2021-04-06
    • 2017-08-25
    • 2019-05-19
    • 2021-07-07
    • 2020-10-06
    • 2020-09-21
    • 2021-04-01
    • 2018-07-09
    • 1970-01-01
    相关资源
    最近更新 更多