How can I check if the message author has an admin role using Discord.js?

后端 未结 3 496
挽巷
挽巷 2021-01-06 22:44

I\'m building a Discord bot and I want to have an if statement that will only proceed if the message author has an administrator role in the guild.

I\'v

3条回答
  •  离开以前
    2021-01-06 23:23

    On the GuildMember object, you have a hasPermission function available. So you can just do member.hasPermission('ADMINISTRATOR')

    If you are interested in all the other strings, that are permission resolvable, you can find them in the discord.js docs.

提交回复
热议问题