Check user permission #7717
-
Hello. How can we check the user's permission and do it if the user has permission to do something? |
Beta Was this translation helpful? Give feedback.
Answered by
AbstractUmbra
Mar 18, 2022
Replies: 1 comment 1 reply
-
There are multiple ways you can do this: If you want to check their overall permissions within a Guild, you have If you want their permissions in a specific channel, you have There is a method that utilises overwrites too if you're interested in that? |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mmdbalkhi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are multiple ways you can do this:
If you want to check their overall permissions within a Guild, you have
Member.guild_permissions
, which is an instance ofPermissions
, so you can check the attributes of it.If you want their permissions in a specific channel, you have
GuildChannel.permissions_for
, which returns the same type.There is a method that utilises overwrites too if you're interested in that?