Permissions¶
Note
The following classes come from the scurrypy.core.permissions module.
Permissions
¶
Guild/User permission flags.
Note
Not all permissions are listed. Permissions not listed are not yet supported.
CREATE_INSTANT_INVITE = 1 << 0
class-attribute
instance-attribute
¶
Allows creation of instant invites.
KICK_MEMBERS = 1 << 1
class-attribute
instance-attribute
¶
Allows kicking members.
BAN_MEMBERS = 1 << 2
class-attribute
instance-attribute
¶
Allows banning members.
ADMINISTRATOR = 1 << 3
class-attribute
instance-attribute
¶
Allows all permissions and bypasses channel permission overwrites.
MANAGE_CHANNELS = 1 << 4
class-attribute
instance-attribute
¶
Allows management and editing of channels
MANAGE_GUILD = 1 << 5
class-attribute
instance-attribute
¶
Allows management and editing of the guild.
ADD_REACTIONS = 1 << 6
class-attribute
instance-attribute
¶
Allows for adding new reactions to messages.
Warning
This permission does not apply to reacting with an existing reaction on a message.
VIEW_CHANNEL = 1 << 10
class-attribute
instance-attribute
¶
Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels.
SEND_MESSAGES = 1 << 11
class-attribute
instance-attribute
¶
Allows for sending messages in a channel and creating threads in a forum.
Warning
Does not allow sending messages in threads.
MANAGE_MESSAGES = 1 << 13
class-attribute
instance-attribute
¶
Allows for deletion of other users messages.
EMBED_LINKS = 1 << 14
class-attribute
instance-attribute
¶
Links sent by users with this permission will be auto-embedded.
ATTACH_FILES = 1 << 15
class-attribute
instance-attribute
¶
Allows for uploading images and files.
READ_MESSAGE_HISTORY = 1 << 16
class-attribute
instance-attribute
¶
Allows for reading of message history.
USE_EXTERNAL_EMOJIS = 1 << 18
class-attribute
instance-attribute
¶
Allows the usage of custom emojis from other servers.
MANAGE_ROLES = 1 << 28
class-attribute
instance-attribute
¶
Allows management and editing of roles.
USE_APPLICATION_COMMANDS = 1 << 31
class-attribute
instance-attribute
¶
Allows members to use application commands, including slash commands and context menu commands.
MANAGE_THREADS = 1 << 34
class-attribute
instance-attribute
¶
Allows for deleting and archiving threads, and viewing all private threads.
CREATE_PUBLIC_THREADS = 1 << 35
class-attribute
instance-attribute
¶
Allows for creating public and announcement threads.
CREATE_PRIVATE_THREADS = 1 << 36
class-attribute
instance-attribute
¶
Allows for creating private threads.
SEND_MESSAGES_IN_THREADS = 1 << 38
class-attribute
instance-attribute
¶
Allows for sending messages in threads.
MODERATE_MEMBERS = 1 << 40
class-attribute
instance-attribute
¶
Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels.
SEND_POLLS = 1 << 49
class-attribute
instance-attribute
¶
Allows sending polls.
PIN_MESSAGES = 1 << 51
class-attribute
instance-attribute
¶
Allows pinning and unpinning messages.
BYPASS_SLOWMODE = 1 << 52
class-attribute
instance-attribute
¶
Allows bypassing slowmode restrictions.
set
staticmethod
¶
Set permissions. See Permission.
Parameters:
-
**flags(Unpack[PermissionsFlagParams], default:{}) –permissions to set
Raises:
-
ValueError–invalid flag
Returns:
-
int–combined permissions field
has
staticmethod
¶
Checks if a permission bit is toggled.
Parameters:
-
permissions(int) –permissions integer
-
permission(int) –permission bit to check
Returns:
-
bool–if permission bit is toggled
PermissionsFlagParams
¶
Bases: TypedDict
Role/User permission selection parameters.
Important
Param name MUST match the permission it represents! For example, "KICK_MEMBERS" is "kick_members".