discord-interactions.py

PermissionConfig

Classe

Ensemble des restrictions d'une commande, rempli par les décorateurs.

from discord_interactions.slash import PermissionConfig

Constructeur

PermissionConfig(    user_permissions: int = 0,    bot_permissions: int = 0,    default_member_permissions: int | None = None,    dm_permission: bool = True,    contexts: List[int] | None = None,    integration_types: List[int] | None = None,    nsfw: bool = False,    checks: List[Callable[[discord.Interaction], Awaitable[bool]]] = <factory>,    owner_only: bool = False,    owner_ids: Set[int] = <factory>,    guild_only: bool = False,    allowed_guilds: Set[int] | None = None,    blocked_guilds: Set[int] = <factory>,    allowed_users: Set[int] | None = None,    blocked_users: Set[int] = <factory>,    required_roles: Set[int] | None = None,    required_any_role: Set[int] | None = None,    allowed_channels: Set[int] | None = None,    blocked_channels: Set[int] = <factory>,    allowed_categories: Set[int] | None = None,    allowed_hours: Set[int] | None = None,)
NomTypeDéfautDescription
user_permissionsint0
bot_permissionsint0
default_member_permissionsint | NoneNone
dm_permissionboolTrue
contextsList[int] | NoneNone
integration_typesList[int] | NoneNone
nsfwboolFalse
checksList[Callable[[discord.Interaction], Awaitable[bool]]]<factory>
owner_onlyboolFalse
owner_idsSet[int]<factory>
guild_onlyboolFalse
allowed_guildsSet[int] | NoneNone
blocked_guildsSet[int]<factory>
allowed_usersSet[int] | NoneNone
blocked_usersSet[int]<factory>
required_rolesSet[int] | NoneNone
required_any_roleSet[int] | NoneNone
allowed_channelsSet[int] | NoneNone
blocked_channelsSet[int]<factory>
allowed_categoriesSet[int] | NoneNone
allowed_hoursSet[int] | NoneNone

Propriétés

NomTypeDescription
user_permissionsint
bot_permissionsint
default_member_permissionsint | None
dm_permissionbool
contextsList[int] | None
integration_typesList[int] | None
nsfwbool
checksList[Callable[[discord.Interaction], Awaitable[bool]]]
owner_onlybool
owner_idsSet[int]
guild_onlybool
allowed_guildsSet[int] | None
blocked_guildsSet[int]
allowed_usersSet[int] | None
blocked_usersSet[int]
required_rolesSet[int] | None
required_any_roleSet[int] | None
allowed_channelsSet[int] | None
blocked_channelsSet[int]
allowed_categoriesSet[int] | None
allowed_hoursSet[int] | None

Méthodes

to_api_dict

def to_api_dict() -> dict

Tape un nom : create_button, ModalBuilder, cooldown.