discord_styled.utils.permissions
Module with utility functions for slash command permissions
Permissions
Class, creates a slash command permissions template
Permissions(self, guild_id:Union[int, list[int]])
1
guild_id - List of guild ids
Methods
everyone_permission()
Allow or deny permissions for @everyone
everyone_permission(allow:bool=False)
1
Parameters
- allow (
bool, optional
) - Whether to allow or deny permission. Defaults toFalse
.
Allow or deny permissions for a list of role ids
allow_roles(roles:list[int], allow:bool=True)
1
Parameters
- roles (
list[int]
) - List of role ids - allow (
bool, optional
) - Whether to allow or deny permission. Default toTrue
.
allow_only_roles()
Deny permissions to @everyone and allow them to a list of role ids.
only_allow_roles(roles:list[int])
1
Parameters
- roles (
list[int]
) - List of role ids
deny_roles()
Deny permissions to a list of role ids, same as allow_roles(..., False)
.
deny_roles(roles:list[int])
1
Parameters
- roles (
list[int]
) - List of role ids
allow_users()
Allow or deny permissions to a list of user ids
allow_users(users:list[int], allow:bool=True)
1
Parameters
- users (
list[int]
) - List of role ids - allow (
bool, optional
) - Whether to allow or deny permission. Defaults toTrue
.
allow_only_users()
Deny permissions to @everyone and allow them to a list of user ids
allow_only_users(users:list[int])
1
Parameters
- users (
list[int]
) - List of role ids
deny_users()
Deny permissions to a list of user ids, same as allow_users(..., False)
.
deny_users(users:list[int])
1
Parameters
- users (
list[int]
) - List of role ids