📜  检查机器人是否有权限 discord.js - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:55.935000             🧑  作者: Mango

代码示例1
//Check if my bot has permission ADMINISTRATOR
const guild = Client.guild.cache.get("GUILD_ID");
if(guild.me.hasPermission("ADMINISTRATOR")) {
    console.log("I have the Permission Administrator");
}else {
    console.log("I don't have Permission Administrator");
}