PermissionConfig
Class
Every restriction of a command, filled by the decorators.
from discord_interactions.slash import PermissionConfigConstructor
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,)| Name | Type | Default | Description |
|---|---|---|---|
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 |
Properties
| Name | Type | Description |
|---|---|---|
user_permissions | int | |
bot_permissions | int | |
default_member_permissions | int | None | |
dm_permission | bool | |
contexts | List[int] | None | |
integration_types | List[int] | None | |
nsfw | bool | |
checks | List[Callable[[discord.Interaction], Awaitable[bool]]] | |
owner_only | bool | |
owner_ids | Set[int] | |
guild_only | bool | |
allowed_guilds | Set[int] | None | |
blocked_guilds | Set[int] | |
allowed_users | Set[int] | None | |
blocked_users | Set[int] | |
required_roles | Set[int] | None | |
required_any_role | Set[int] | None | |
allowed_channels | Set[int] | None | |
blocked_channels | Set[int] | |
allowed_categories | Set[int] | None | |
allowed_hours | Set[int] | None |
Methods
to_api_dict
def to_api_dict() -> dict