how to know if the user have administrator permission in latest version #8570
-
Hi, djs changed a lot since i stopped making bots, now that im back a lot of thinks changed and i dont find the way to check if msg.member have "ADMINISTRATOR" permissions |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
I think you can use |
Beta Was this translation helpful? Give feedback.
-
I did some research and found a way you can use and give me feedback. |
Beta Was this translation helpful? Give feedback.
-
For base permissions (guild level, default role and any roles the member might have): message.member.permissions.has(PermissionFlagsBits.Administrator); For permissions after channel overwrites: If using command interactions, you can get the permissions of the member executing the command after overwrites through You can find more information on Permissions in general in our guide at https://discordjs.guide/popular-topics/permissions.html |
Beta Was this translation helpful? Give feedback.
For base permissions (guild level, default role and any roles the member might have):
For permissions after channel overwrites:
https://discordjs.guide/popular-topics/permissions.html#permissions-after-overwrites
If using command interactions, you can get the permissions of the member executing the command after overwrites through
https://discord.js.org/#/docs/discord.js/14.3.0/class/CommandInteraction?scrollTo=memberPermissions instead. Checking for the flag works exactly the same as above.
You can find more information on Permissions in general in our guide at https://discordjs.guide/popular-topics/permissions.html