# discord-interactions-py 0.3.0 (compact) > Python module for Discord interactions on top of discord.py: buttons, select menus, Components V2, modals and slash commands, built as raw Discord API payloads. No `discord.ui.View`, no `app_commands.CommandTree`. Full docs with guides and examples: https://discordpy.levraiberet.ovh/llms-full.txt. One page in Markdown: add `index.md` to any docs URL. ## Rules for writing code with this module 1. Install `pip install levraiberet-discord-interactions`, import `discord_interactions` (slash commands: `discord_interactions.slash`). Python 3.9+, discord.py 2.6+. 2. Do NOT use `discord.ui.View`, `discord.ui.Button`, `discord.ui.Modal` or `app_commands`: this module replaces them. Components are plain dicts built by `create_*` functions or builders (`container()`, `section()`, `ModalBuilder`). 3. One entry point for components: `router = InteractionRouter()` and `@client.event async def on_interaction(interaction): await router.handle(interaction)`. Slash commands are handled by `slash = SlashManager(client)` on its own (auto-synced on ready). 4. Routing uses the `base_id`, the part of `custom_id` before `:`. `@router.on("id")` for buttons and selects, `@router.modal("id")` for modals. Handler signature: `(interaction)`, `(interaction, data)` or `(interaction, data, base_id)`; for a modal, `data` holds the submitted values. 5. `create_button("id", "Label", data={...})` stores data in the custom_id (100 characters max in total) and it comes back as `data`. Use `create_signed_button` / `parse_signed_custom_id` when the data must not be forged. 6. Every interaction must be answered within 3 seconds, exactly once: `respond_to_interaction`, `update_message` (edits the clicked message), `send_modal`, or `defer_interaction` then `send_followup` / `edit_original_response`. `respond()` and `ctx.respond()` switch to a followup automatically. 7. A modal must be the first response (never after a defer). 5 components max per modal. Read values with `values["id"]`: `str` for text and radio, `bool` for a checkbox, `list` for selects, checkbox groups and uploads. 8. Select values are always a list. Users, roles, channels: `parse_values(interaction).users("id")`, `.roles("id")`, `.channels("id")`, `.mentionables("id")`. 9. Components V2 (`container`, `section`, `mediaGallery`, `separator`, `textDisplay`) cannot be mixed with embeds. The IS_COMPONENTS_V2 flag is added automatically and `content` is turned into a text display. 10. Discord limits: 5 buttons per row, 5 rows (V1), 25 select options, 80-character button labels, unique custom_id per message. ## Minimal bot ```python import os import discord from discord_interactions import InteractionRouter, create_action_row, create_button, update_message from discord_interactions.slash import SlashManager client = discord.Client(intents=discord.Intents.default()) slash = SlashManager(client) # slash commands, synced automatically on ready router = InteractionRouter() # buttons, selects and modals @slash.command(description="Say hello") async def hello(ctx): button = create_button("wave", "Wave back", data={"from": ctx.user.id}) await ctx.respond(f"Hello {ctx.user.mention}!", components=[create_action_row(button)]) @router.on("wave") async def wave(interaction, data): await update_message(interaction, content=f"<@{data['from']}> got a wave!", components=[]) @client.event async def on_interaction(interaction): await router.handle(interaction) client.run(os.environ["DISCORD_BOT_TOKEN"]) ``` ## API (every public symbol) Import from `discord_interactions` unless marked `[slash]` (= `discord_interactions.slash`). ### Buttons - `create_button(custom_id: str = '', label: str = '', style: str | int = 1, emoji: str | Dict[str, Any] | Any | None = None, data: Dict[str, Any] | None = None, disabled: bool = False, url: str | None = None, sku_id: int | str | None = None, component_id: int | None = None) -> Dict[str, Any]`: Creates a button. Values passed in `data` travel inside the `custom_id` and come back on click. - `create_link_button(url: str, label: str = '', emoji: str | Dict[str, Any] | Any | None = None, disabled: bool = False) -> Dict[str, Any]`: Button that opens a URL. No event reaches the bot. - `create_premium_button(sku_id: int | str, disabled: bool = False) -> Dict[str, Any]`: Purchase button for one of your application's SKUs (Discord monetization). ### Select menus - `create_channel_select_menu(custom_id: str, placeholder: str | None = 'Select channels', min_values: int | None = 1, max_values: int | None = 1, disabled: bool = False, default_values: Sequence[Any] | None = None, channel_types: Sequence[int] | None = None, required: bool | None = None, component_id: int | None = None) -> Dict[str, Any]`: Channel select menu, filterable by type. - `create_entity_select_menu(custom_id: str, select_type: int, placeholder: str | None = 'Select', min_values: int | None = 1, max_values: int | None = 1, disabled: bool = False, default_values: Sequence[Any] | None = None, channel_types: Sequence[int] | None = None, required: bool | None = None, component_id: int | None = None) -> Dict[str, Any]`: Generic entity select menu: users (5), roles (6), mentionables (7) or channels (8). - `create_mentionable_select_menu(custom_id: str, placeholder: str | None = 'Select mentionables', min_values: int | None = 1, max_values: int | None = 1, disabled: bool = False, default_values: Sequence[Any] | None = None, required: bool | None = None, component_id: int | None = None) -> Dict[str, Any]`: Select menu mixing users and roles. - `create_role_select_menu(custom_id: str, placeholder: str | None = 'Select roles', min_values: int | None = 1, max_values: int | None = 1, disabled: bool = False, default_values: Sequence[Any] | None = None, required: bool | None = None, component_id: int | None = None) -> Dict[str, Any]`: Role select menu. - `create_select_menu(custom_id: str, placeholder: str | None = 'Select an option', options: Sequence[Any] | None = None, min_values: int | None = 1, max_values: int | None = 1, disabled: bool = False, required: bool | None = None, component_id: int | None = None) -> Dict[str, Any]`: Text select menu (25 options max). Options accept dicts, tuples or strings. - `create_user_select_menu(custom_id: str, placeholder: str | None = 'Select users', min_values: int | None = 1, max_values: int | None = 1, disabled: bool = False, default_values: Sequence[Any] | None = None, required: bool | None = None, component_id: int | None = None) -> Dict[str, Any]`: User or member select menu. - `default_value(value: Any, kind: str) -> Dict[str, str]`: Pre-selected value of an entity select menu. - `select_option(label: str, value: str | None = None, description: str | None = None, emoji: str | Dict[str, Any] | Any | None = None, default: bool | None = None) -> Dict[str, Any]`: Option for a select menu, a radio group or a checkbox group. ### Builders - `class ActionRowBuilder(*components: Any) -> None`: Action row builder. Methods: `.addComponents()`, `.to_dict()`, `.id()`, `.build()` - `class ContainerBuilder(*components: Any, accent_color: int | None = None, spoiler: bool = False) -> None`: Chainable container V2 builder. Every method returns the builder; finish with `build()`. Methods: `.setAccentColor()`, `.setSpoiler()`, `.add()`, `.addTextDisplayComponents()`, `.addSeparatorComponents()`, `.addSectionComponents()`, `.addMediaGalleryComponents()`, `.addFileComponents()`, `.addActionRowComponents()`, `.text()`, `.separator()`, `.gallery()`, `.file()`, `.row()`, `.to_dict()`, `.id()`, `.build()` - `class FileBuilder(filename: str = '', spoiler: bool = False) -> None`: Attached file builder. Methods: `.setFile()`, `.setSpoiler()`, `.to_dict()`, `.id()`, `.build()` - `class MediaGalleryBuilder(*urls: Any) -> None`: Gallery builder; `add()` appends an image with alt text or spoiler. Methods: `.addItem()`, `.to_dict()`, `.id()`, `.build()` - `class SectionBuilder() -> None`: Section builder: texts on the left, button or thumbnail on the right. Methods: `.addTextDisplayComponents()`, `.setButtonAccessory()`, `.setThumbnailAccessory()`, `.accessory()`, `.to_dict()`, `.id()`, `.build()` - `class SeparatorBuilder(divider: bool = True, spacing: int | str = 1) -> None`: Separator builder. Methods: `.setDivider()`, `.setSpacing()`, `.to_dict()`, `.id()`, `.build()` - `class TextDisplayBuilder(content: str = '') -> None`: Text block builder. Methods: `.setContent()`, `.to_dict()`, `.id()`, `.build()` - `class ThumbnailBuilder(url: Any = '', description: str | None = None, spoiler: bool = False) -> None`: Thumbnail builder. Methods: `.setURL()`, `.setDescription()`, `.setSpoiler()`, `.to_dict()`, `.id()`, `.build()` - `actionRow(*components: Any) -> ActionRowBuilder`: Shortcut for `ActionRowBuilder(*components)`. - `container(*components: Any, accent_color: int | None = None, spoiler: bool = False) -> ContainerBuilder`: Shortcut for `ContainerBuilder(...)`. - `fileComponent(filename: str, spoiler: bool = False) -> FileBuilder`: Shortcut for `FileBuilder(filename, spoiler)`. - `mediaGallery(*urls: Any) -> MediaGalleryBuilder`: Shortcut for `MediaGalleryBuilder(*urls)`. - `section(*texts: Any) -> SectionBuilder`: Shortcut for `SectionBuilder` with its texts. - `separator(divider: bool = True, spacing: int | str = 1) -> SeparatorBuilder`: Shortcut for `SeparatorBuilder(divider, spacing)`. - `textDisplay(content: str = '') -> TextDisplayBuilder`: Shortcut for `TextDisplayBuilder(content)`. - `thumbnail(url: Any, description: str | None = None, spoiler: bool = False) -> ThumbnailBuilder`: Shortcut for `ThumbnailBuilder(url, description, spoiler)`. ### Components V2 - `create_action_row(*components: Any, component_id: int | None = None) -> Dict[str, Any]`: Action row (type 1): up to 5 buttons or a single select menu. - `create_button_row(*buttons: Any) -> Dict[str, Any]`: Row of buttons. Same as `create_action_row`. - `create_container(*components: Any, accent_color: int | None = None, spoiler: bool = False, component_id: int | None = None) -> Dict[str, Any]`: Container (type 17): the card grouping components V2. A string becomes a text block. - `create_file(filename: str, spoiler: bool = False, component_id: int | None = None) -> Dict[str, Any]`: Attached file shown in the message (type 13). Send the file itself with `files=`. - `create_media_gallery(*items: Any, component_id: int | None = None) -> Dict[str, Any]`: Gallery of 1 to 10 images or videos (type 12). - `create_media_item(url: str | Dict[str, Any], description: str | None = None, spoiler: bool = False) -> Dict[str, Any]`: Gallery item: media, alt text and spoiler. - `create_modal_row(component: Any) -> Dict[str, Any]`: Modal row in the legacy format (ActionRow + TextInput). - `create_section(*texts: Any, accessory: Any, component_id: int | None = None) -> Dict[str, Any]`: Section (type 9): 1 to 3 texts with an accessory, button or thumbnail. - `create_select_row(select_menu: Any) -> Dict[str, Any]`: Row holding a select menu. - `create_separator(divider: bool = True, spacing: int | str = 1, component_id: int | None = None) -> Dict[str, Any]`: Separator (type 14): divider line and vertical spacing. - `create_text_display_component(content: str, component_id: int | None = None) -> Dict[str, Any]`: Markdown text block (type 10), up to 4000 characters. - `create_thumbnail(url: str | Dict[str, Any], description: str | None = None, spoiler: bool = False, component_id: int | None = None) -> Dict[str, Any]`: Thumbnail (type 11), used as the accessory of a section. - `disable_all_components(components: Sequence[Any]) -> List[Dict[str, Any]]`: Copy of the components with every button and select disabled, at any depth. ### Modal fields - `create_checkbox(custom_id: str, default: bool = False, component_id: int | None = None) -> Dict[str, Any]`: Single yes or no checkbox. Always optional. - `create_checkbox_group(custom_id: str, options: Sequence[Any], placeholder: str | None = None, min_values: int | None = 0, max_values: int | None = None, disabled: bool = False, required: bool = False, component_id: int | None = None) -> Dict[str, Any]`: Checkbox group (1 to 10 options, multiple choices). - `create_file_upload_component(custom_id: str, min_values: int | None = None, max_values: int | None = None, required: bool = True, file_types: Sequence[str] | None = None, component_id: int | None = None) -> Dict[str, Any]`: File upload inside a modal (0 to 10 files), filterable by type. - `create_label_component(label: str, description: str | None = None, component: Any | None = None, component_id: int | None = None) -> Dict[str, Any]`: Label (type 18): title and description around a modal field. The modern format recommended by Discord. - `create_modal(custom_id: str, title: str, *components: Any, strict_text_inputs: bool = False) -> Dict[str, Any]`: Complete modal as a dict. Bare fields are wrapped in a Label automatically. - `create_radio_group(custom_id: str, options: Sequence[Any], placeholder: str | None = None, disabled: bool = False, required: bool = True, component_id: int | None = None) -> Dict[str, Any]`: Radio group (2 to 10 options, single choice). - `create_text_input(custom_id: str, label: str | None = None, style: str | int = 1, placeholder: str | None = None, min_length: int | None = None, max_length: int | None = None, required: bool = True, value: str | None = None, component_id: int | None = None) -> Dict[str, Any]`: Modal text field, short or paragraph. ### Types and constants - `ButtonStyle`: Button styles: `Primary` (1), `Secondary` (2), `Success` (3), `Danger` (4), `Link` (5) and `Premium` (6). Values: Primary, Secondary, Success, Danger, Link, Premium - `ComponentType`: Type numbers of every Discord component, from action row (1) to checkbox (23). Values: ActionRow, Button, StringSelect, TextInput, UserSelect, RoleSelect, MentionableSelect, ChannelSelect, Section, TextDisplay, Thumbnail, MediaGallery, File, Separator, Container, Label, FileUpload, RadioGroup, CheckboxGroup, Checkbox - `SeparatorSpacing`: Separator spacing: `Small` (1) or `Large` (2). Values: Small, Large - `TextInputStyle`: Text input style: `Short` (single line) or `Paragraph` (multiple lines). Values: Short, Paragraph - `create_component(component_type: int, **fields: Any) -> Dict[str, Any]`: Raw component: `{"type": component_type, **fields}`. Handy for a type the module does not cover yet. ### Building modals - `class ModalBuilder(custom_id: str, title: str, data: Dict[str, Any] | None = None) -> None`: Modern modal builder: every field sits in a Label with a title and description. 5 components max. Methods: `.add()`, `.text()`, `.text_input()`, `.paragraph()`, `.select()`, `.user_select()`, `.role_select()`, `.mentionable_select()`, `.channel_select()`, `.radio()`, `.checkboxes()`, `.checkbox()`, `.file_upload()`, `.to_dict()` ### Reading values - `class ModalSubmit(interaction: discord.Interaction) -> None`: Submitted values keyed by `custom_id`. Text and radio as `str`, checkbox as `bool`, everything else as `list`. Methods: `.get()`, `.type_of()`, `.to_dict()`, `.attachments()`, `.users()`, `.roles()`, `.channels()`, `.mentionables()` - `get_modal_values(interaction: discord.Interaction) -> Dict[str, Any]`: Modal values as a `{custom_id: value}` dict. - `parse_modal(interaction: discord.Interaction) -> ModalSubmit`: Reads the values of a submitted modal. Same as `parse_values`. - `parse_values(interaction: discord.Interaction) -> ModalSubmit`: Reads the values of a modal or a select menu, with entities and files resolved. ### Sending and replying - `async defer_interaction(interaction: discord.Interaction, update: bool = False, ephemeral: bool = False, thinking: bool = True) -> None`: Acknowledges now to answer later (15 minutes). On a component, `update=True` shows nothing. - `async delete_original_response(interaction: discord.Interaction, message_id: str | int = '@original') -> None`: Deletes the original response, or a followup with `message_id`. - `async edit_message(message: discord.Message | discord.InteractionMessage | Any, content: str | None = None, embed: discord.Embed | None = None, embeds: List[discord.Embed] | None = None, components: Dict[str, Any] | Any | Sequence[Dict[str, Any] | Any] | None = None, allowed_mentions: Dict[str, Any] | discord.AllowedMentions | None = None, flags: int | None = None, files: Sequence[discord.File] | None = None, attachments: Sequence[Any] | None = None, **kwargs: Any) -> Any`: Edits an existing message. Attachments are kept when `attachments` is omitted. - `async edit_original_response(interaction: discord.Interaction, content: str | None = None, embed: discord.Embed | None = None, embeds: List[discord.Embed] | None = None, components: Dict[str, Any] | Any | Sequence[Dict[str, Any] | Any] | None = None, allowed_mentions: Dict[str, Any] | discord.AllowedMentions | None = None, flags: int | None = None, files: Sequence[discord.File] | None = None, attachments: Sequence[Any] | None = None, message_id: str | int = '@original') -> Dict[str, Any]`: Edits the original response, or a followup with `message_id`. - `async get_original_response(interaction: discord.Interaction) -> Dict[str, Any]`: Fetches the original response (API dict), for example to get its ID. - `async respond(interaction: discord.Interaction, content: str | None = None, **kwargs: Any) -> Any`: Responds to the interaction, or sends a followup if it was already answered. - `async respond_to_interaction(interaction: discord.Interaction, content: str | None = None, embed: discord.Embed | None = None, embeds: List[discord.Embed] | None = None, components: Dict[str, Any] | Any | Sequence[Dict[str, Any] | Any] | None = None, allowed_mentions: Dict[str, Any] | discord.AllowedMentions | None = None, ephemeral: bool = False, update: bool = False, flags: int | None = None, files: Sequence[discord.File] | None = None, with_response: bool = False, **kwargs: Any) -> Any`: Initial interaction response. With `update=True`, edits the message of the clicked component. - `async send_followup(interaction: discord.Interaction, content: str | None = None, embed: discord.Embed | None = None, embeds: List[discord.Embed] | None = None, components: Dict[str, Any] | Any | Sequence[Dict[str, Any] | Any] | None = None, allowed_mentions: Dict[str, Any] | discord.AllowedMentions | None = None, ephemeral: bool = False, flags: int | None = None, files: Sequence[discord.File] | None = None) -> Dict[str, Any]`: Followup message after a response or a defer. - `async send_message(destination: Any, content: str | None = None, embed: discord.Embed | None = None, embeds: List[discord.Embed] | None = None, components: Dict[str, Any] | Any | Sequence[Dict[str, Any] | Any] | None = None, allowed_mentions: Dict[str, Any] | discord.AllowedMentions | None = None, tts: bool = False, files: Sequence[discord.File] | None = None, flags: int | None = None, file: discord.File | None = None, reply_to: Any | None = None, poll: Any | None = None, ephemeral: bool = False, **kwargs: Any) -> discord.Message | None`: Sends a message to a channel, a thread, a context, a member's DMs, or as an interaction response. - `async send_modal(interaction: discord.Interaction, custom_id: str | Dict[str, Any] | Any, title: str | None = None, components: Sequence[Dict[str, Any] | Any] | None = None) -> None`: Opens a modal. Accepts a `ModalBuilder`, a `create_modal` dict or the three separate arguments. - `async update_message(interaction: discord.Interaction, **kwargs: Any) -> Any`: Edits the message of the clicked component. Shortcut for `respond_to_interaction(..., update=True)`. ### Updating components - `class DisableAllHandle(message: Any, delay_ms: int = 0)`: Disable timer: `refresh()`, `cancel()`, `force_disable()`, `is_active()`. Methods: `.refresh()`, `.cancel()`, `.force_disable()`, `.is_active()` - `add_component(container: Any, components: Any | Sequence[Any], position: int | None = None) -> Any`: Inserts components into a builder or a container dict. - `disable_all(message: Any, delay_ms: int = 0) -> DisableAllHandle`: Disables every component of a message, now or after a delay. - `disable_all_by_message_id(channel: Any, message_id: int | str, delay_ms: int = 0) -> DisableAllHandle`: Like `disable_all`, from a channel and a message ID. - `disable_buttons(components: Dict[str, Any] | Sequence[Dict[str, Any]]) -> List[Dict[str, Any]]`: Copy of the components with buttons and selects disabled; Link buttons stay active. - `async remove_component(message: Any, selector: str | Callable[[Dict[str, Any]], bool], remove_empty_rows: bool = True) -> bool`: Removes the matching components; rows left empty disappear too. - `async row_update(message: Any, row_selector: str | int | Callable[[Dict[str, Any], int], bool], updater: Callable[[Dict[str, Any]], Dict[str, Any] | None] | Callable[[Dict[str, Any]], Awaitable[Dict[str, Any] | None]]) -> bool`: Transforms every component of one or more rows with a function. - `async row_update_one(message: Any, row_selector: str | int | Callable[[Dict[str, Any], int], bool], updater: Callable[[Dict[str, Any]], Dict[str, Any] | None] | Callable[[Dict[str, Any]], Awaitable[Dict[str, Any] | None]]) -> bool`: Like `row_update`, but only when exactly one row matches. - `async update_component(message: Any, selector: str | Callable[[Dict[str, Any]], bool], updates: Dict[str, Any]) -> bool`: Reloads the message, then updates every matching component. - `async update_component_one(message: Any, selector: str | Callable[[Dict[str, Any]], bool], updates: Dict[str, Any]) -> bool`: Like `update_component`, but only when exactly one component matches. ### Payloads - `MessageFlags`: Message flags: `EPHEMERAL`, `IS_COMPONENTS_V2`, `SUPPRESS_EMBEDS`, `SUPPRESS_NOTIFICATIONS` and the other API flags. Values: CROSSPOSTED, SUPPRESS_EMBEDS, EPHEMERAL, LOADING, SUPPRESS_NOTIFICATIONS, IS_VOICE_MESSAGE, IS_COMPONENTS_V2 - `build_message_payload(content: str | None = None, embed: discord.Embed | None = None, embeds: Sequence[discord.Embed] | None = None, components: Dict[str, Any] | Any | Sequence[Dict[str, Any] | Any] | None = None, allowed_mentions: Dict[str, Any] | discord.AllowedMentions | None = None, flags: int | None = None, tts: bool = False, ephemeral: bool = False, attachments: Sequence[Any] | None = None, files: Sequence[discord.File] | None = None, poll: Any | None = None, message_reference: Any | None = None) -> Dict[str, Any]`: Builds a message payload for any endpoint. Adds `IS_COMPONENTS_V2` and turns `content` into a text block when needed. - `parse_allowed_mentions(allowed_mentions: Dict[str, Any] | discord.AllowedMentions | None) -> Dict[str, Any] | None`: Normalizes allowed mentions: discord.py object, API payload, discord.js style or boolean switches. ### Routing - `class InteractionRouter() -> None`: Routes buttons, select menus and modals to handlers by the `base_id` of their `custom_id`. Methods: `.on()`, `.modal()`, `.fallback()`, `.handle()` ### Signed custom_id - `build_signed_custom_id(base_id: str, data: Dict[str, Any] | None, secret: str, ttl_seconds: int | None = None, max_length: int = 100) -> str`: `custom_id` signed with HMAC-SHA256, with optional expiry. Cannot be forged without the secret. - `create_auto_rows(components: Sequence[Dict[str, Any]], max_buttons_per_row: int = 5) -> List[Dict[str, Any]]`: Places buttons and select menus into valid rows automatically. - `create_signed_button(base_id: str, secret: str, data: Dict[str, Any] | None = None, ttl_seconds: int | None = None, label: str = '', style: int | str = 'Primary', emoji: str | Dict[str, Any] | None = None, disabled: bool = False, max_custom_id_length: int = 100) -> Dict[str, Any]`: Button with a signed `custom_id`. - `parse_signed_custom_id(custom_id: str, secret: str, enforce_expiry: bool = True) -> Tuple[str, Dict[str, Any], bool, str]`: Verifies a signed `custom_id`. Returns `(base_id, data, valid, reason)`. - `async respond_or_followup(interaction: discord.Interaction, *, content: str | None = None, embed: discord.Embed | None = None, embeds: List[discord.Embed] | None = None, components: Iterable[Any] | None = None, ephemeral: bool = False, flags: int | None = None, **kwargs: Any) -> Any`: Initial response when possible, otherwise a followup. ### Shortcuts - `quick_button(base_id: str, label: str, *, style: str | int = 'Primary', emoji: str | Dict[str, Any] | None = None, data: Dict[str, Any] | None = None, disabled: bool = False, url: str | None = None) -> Dict[str, Any]`: One-line button. - `quick_container(*, title: str | None = None, lines: Iterable[str] | None = None, color: int | None = 5793266, button: Dict[str, Any] | None = None, button_text: str = 'Action', buttons: Sequence[Dict[str, Any]] | None = None, separator_between_lines: bool = False, thumbnail: str | None = None) -> Dict[str, Any]`: Complete container in one call: title, lines, thumbnail, section button or row of buttons. - `quick_row(*buttons: Dict[str, Any] | Sequence[Dict[str, Any]]) -> Dict[str, Any]`: Row of buttons: `quick_row(b1, b2)` or `quick_row([b1, b2])`. - `async quick_send_container(destination: Any, *, title: str | None = None, lines: Iterable[str] | None = None, color: int | None = 5793266, button: Dict[str, Any] | None = None, buttons: Sequence[Dict[str, Any]] | None = None, separator_between_lines: bool = False, content: str | None = None, **kwargs: Any)`: Sends a `quick_container` directly. ### custom_id - `build_custom_id(base_id: str, data: Dict[str, Any] | None = None, max_length: int = 100) -> str`: `base_id:data` as compact JSON in url-safe base64. Raises past 100 characters. - `decode_data(encoded: str) -> Dict[str, Any]`: Decodes `custom_id` data; returns `{}` when invalid. - `encode_data(data: Dict[str, Any]) -> str`: Encodes a dict as compact JSON in url-safe base64 without padding. - `get_base_custom_id(custom_id: str) -> str`: Part of a `custom_id` before the first `:`. - `parse_custom_id(custom_id: str) -> Tuple[str, Dict[str, Any]]`: Splits a `custom_id` into `(base_id, data)`. Also reads the legacy format. ### HTTP - `CallbackType`: Interaction response types: message (4), deferred (5, 6), update (7), autocomplete (8), modal (9). Values: PONG, CHANNEL_MESSAGE, DEFERRED_CHANNEL_MESSAGE, DEFERRED_UPDATE_MESSAGE, UPDATE_MESSAGE, AUTOCOMPLETE_RESULT, MODAL, LAUNCH_ACTIVITY ### Slash commands - `class SlashCommand(name: str, description: str, callback: Callable[..., Awaitable[Any]], options: List[OptionBase] = , name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, permissions: PermissionConfig = , cooldowns: List[CooldownBucket] = , guild_ids: Set[int] | None = None, parent: str | None = None, group: str | None = None, auto_defer: bool = False, defer_ephemeral: bool = False, ephemeral_by_default: bool = False, _enabled: bool = True) -> None`: A declared command. Created by `@slash.command()`. Methods: `.to_dict()`, `.to_subcommand_dict()`, `.prepare()`, `.invoke()` - `class SlashCommandManager(client: discord.Client, *, owner_ids: Set[int] | None = None, auto_sync: bool = True, sync_on_ready: bool = True, default_guilds: List[int] | None = None) -> None`: Entry point for slash commands: declaration, execution, autocomplete and sync. Alias: `SlashManager`. Methods: `.find_command()`, `.command()`, `.group()`, `.add_middleware()`, `.remove_middleware()`, `.middleware()`, `.on_error()`, `.autocomplete()`, `.build_payload()`, `.sync()`, `.get_command()`, `.get_all_commands()`, `.get_group()`, `.remove_command()` - `class SlashGroup(name: str, description: str, commands: Dict[str, SlashCommand] = , subgroups: Dict[str, SlashGroup] = , name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, guild_ids: Set[int] | None = None, permissions: PermissionConfig = ) -> None`: Command group: `/group subcommand` or `/group subgroup subcommand`. Methods: `.command()`, `.subgroup()`, `.find()`, `.to_dict()` - `option(opt: OptionBase) -> Callable[[~T], ~T]`: Decorator: adds an option to the command. Writing order is kept. - `options(*opts: OptionBase) -> Callable[[~T], ~T]`: Decorator: adds several options at once. ### Context - `class SlashContext(interaction: discord.Interaction, command: SlashCommand | None = None, options: Dict[str, Any] | None = None) -> None`: Command context: interaction, author, channel, options and response methods. Methods: `.get()`, `.respond()`, `.followup()`, `.defer()`, `.edit()`, `.delete()`, `.send_modal()`, `.reply()`, `.send()`, `.think()`, `.set_ephemeral_default()` - `create_context(interaction: discord.Interaction, command: SlashCommand | None = None, options: Dict[str, Any] | None = None) -> SlashContext`: Creates a `SlashContext` (internal use or tests). [slash] ### Options - `class AttachmentOption(name: str, description: str, required: bool = True, name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, default: Any = None, validator: Callable[[Any], bool | str] | None = None, transformer: Callable[[Any], Any] | None = None, allowed_extensions: List[str] | None = None, max_size: int | None = None, file_types: List[str] | None = None) -> None`: Attachment option (created by `Attachment`). Methods: `.to_dict()` [slash] - `class BooleanOption(name: str, description: str, required: bool = True, name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, default: Any = None, validator: Callable[[Any], bool | str] | None = None, transformer: Callable[[Any], Any] | None = None) -> None`: Boolean option (created by `Boolean`). Methods: `.to_dict()` [slash] - `class ChannelOption(name: str, description: str, required: bool = True, name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, default: Any = None, validator: Callable[[Any], bool | str] | None = None, transformer: Callable[[Any], Any] | None = None, channel_types: List[int] | None = None) -> None`: Channel option (created by `Channel`). Methods: `.to_dict()` [slash] - `class Choice(name: str, value: Any, name_localizations: Dict[str, str] | None = None) -> None`: Fixed choice of an option. Methods: `.to_dict()` - `class IntegerOption(name: str, description: str, required: bool = True, name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, default: Any = None, validator: Callable[[Any], bool | str] | None = None, transformer: Callable[[Any], Any] | None = None, min_value: int | None = None, max_value: int | None = None, choices: List[Choice] | None = None, autocomplete: Callable[..., Awaitable[List[Tuple[str, Any]]]] | None = None, step: int | None = None) -> None`: Integer option (created by `Integer`). Methods: `.to_dict()` [slash] - `class MentionableOption(name: str, description: str, required: bool = True, name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, default: Any = None, validator: Callable[[Any], bool | str] | None = None, transformer: Callable[[Any], Any] | None = None) -> None`: Mentionable option (created by `Mentionable`). Methods: `.to_dict()` [slash] - `class NumberOption(name: str, description: str, required: bool = True, name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, default: Any = None, validator: Callable[[Any], bool | str] | None = None, transformer: Callable[[Any], Any] | None = None, min_value: float | None = None, max_value: float | None = None, choices: List[Choice] | None = None, autocomplete: Callable[..., Awaitable[List[Tuple[str, Any]]]] | None = None, precision: int | None = None) -> None`: Decimal option (created by `Number`). Methods: `.to_dict()` [slash] - `class OptionBase(name: str, description: str, required: bool = True, name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, default: Any = None, validator: Callable[[Any], bool | str] | None = None, transformer: Callable[[Any], Any] | None = None) -> None`: Common base of options. Methods: `.to_dict()` [slash] - `class RoleOption(name: str, description: str, required: bool = True, name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, default: Any = None, validator: Callable[[Any], bool | str] | None = None, transformer: Callable[[Any], Any] | None = None, exclude_everyone: bool = True, exclude_managed: bool = False) -> None`: Role option (created by `Role`). Methods: `.to_dict()` [slash] - `class StringOption(name: str, description: str, required: bool = True, name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, default: Any = None, validator: Callable[[Any], bool | str] | None = None, transformer: Callable[[Any], Any] | None = None, min_length: int | None = None, max_length: int | None = None, choices: List[Choice] | None = None, autocomplete: Callable[..., Awaitable[List[Tuple[str, Any]]]] | None = None, pattern: str | None = None, pattern_error: str | None = None, _regex: Pattern[str] | None = None) -> None`: Text option (created by `String`). Methods: `.to_dict()` [slash] - `class UserOption(name: str, description: str, required: bool = True, name_localizations: Dict[str, str] | None = None, description_localizations: Dict[str, str] | None = None, default: Any = None, validator: Callable[[Any], bool | str] | None = None, transformer: Callable[[Any], Any] | None = None, allow_bots: bool = True, require_in_voice: bool = False) -> None`: User option (created by `User`). Methods: `.to_dict()` [slash] - `ChannelTypes`: Channel types and ready-made groups: `TEXT_CHANNELS`, `VOICE_CHANNELS`, `THREAD_CHANNELS`, `ALL_TEXT`. Values: GUILD_TEXT, DM, GUILD_VOICE, GROUP_DM, GUILD_CATEGORY, GUILD_ANNOUNCEMENT, ANNOUNCEMENT_THREAD, PUBLIC_THREAD, PRIVATE_THREAD, GUILD_STAGE_VOICE, GUILD_DIRECTORY, GUILD_FORUM, GUILD_MEDIA, TEXT_CHANNELS, VOICE_CHANNELS, THREAD_CHANNELS, ALL_TEXT - `OptionType`: API option types. Values: SUBCOMMAND, SUBCOMMAND_GROUP, STRING, INTEGER, BOOLEAN, USER, CHANNEL, ROLE, MENTIONABLE, NUMBER, ATTACHMENT [slash] - `Attachment(name: str, description: str, *, required: bool = True, allowed_extensions: List[str] | None = None, max_size: int | None = None, file_types: List[str] | None = None, localizations: Dict[str, Tuple[str, str]] | None = None) -> AttachmentOption`: Attachment option. `file_types` filters on Discord's side, `allowed_extensions` and `max_size` on the bot's side. - `Boolean(name: str, description: str, *, required: bool = True, default: bool | None = None, localizations: Dict[str, Tuple[str, str]] | None = None) -> BooleanOption`: True or false option. - `Channel(name: str, description: str, *, required: bool = True, channel_types: List[int] | None = None, localizations: Dict[str, Tuple[str, str]] | None = None) -> ChannelOption`: Channel option, filterable by type. - `Integer(name: str, description: str, *, required: bool = True, default: Any = None, min_value: int | None = None, max_value: int | None = None, choices: List[Choice | Tuple[str, int]] | None = None, autocomplete: Callable[..., Awaitable[List[Tuple[str, Any]]]] | None = None, step: int | None = None, validator: Callable[[int], bool | str] | None = None, transformer: Callable[[int], Any] | None = None, localizations: Dict[str, Tuple[str, str]] | None = None) -> IntegerOption`: Integer option with bounds, step, choices and autocomplete. - `Mentionable(name: str, description: str, *, required: bool = True, localizations: Dict[str, Tuple[str, str]] | None = None) -> MentionableOption`: User or role option. - `Number(name: str, description: str, *, required: bool = True, default: Any = None, min_value: float | None = None, max_value: float | None = None, choices: List[Choice | Tuple[str, float]] | None = None, autocomplete: Callable[..., Awaitable[List[Tuple[str, Any]]]] | None = None, precision: int | None = None, validator: Callable[[float], bool | str] | None = None, transformer: Callable[[float], Any] | None = None, localizations: Dict[str, Tuple[str, str]] | None = None) -> NumberOption`: Decimal option with bounds and rounding. - `Role(name: str, description: str, *, required: bool = True, exclude_everyone: bool = True, exclude_managed: bool = False, localizations: Dict[str, Tuple[str, str]] | None = None) -> RoleOption`: Role option. The value arrives as `discord.Role`. - `String(name: str, description: str, *, required: bool = True, default: Any = None, min_length: int | None = None, max_length: int | None = None, choices: List[Choice | Tuple[str, str]] | None = None, autocomplete: Callable[..., Awaitable[List[Tuple[str, Any]]]] | None = None, pattern: str | None = None, pattern_error: str | None = None, validator: Callable[[str], bool | str] | None = None, transformer: Callable[[str], Any] | None = None, localizations: Dict[str, Tuple[str, str]] | None = None) -> StringOption`: Text option with length, choices, regex and autocomplete. - `User(name: str, description: str, *, required: bool = True, allow_bots: bool = True, require_in_voice: bool = False, localizations: Dict[str, Tuple[str, str]] | None = None) -> UserOption`: User option. The value arrives as `discord.Member` (or `discord.User` outside guilds). ### Permissions - `class 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]]] = , owner_only: bool = False, owner_ids: Set[int] = , guild_only: bool = False, allowed_guilds: Set[int] | None = None, blocked_guilds: Set[int] = , allowed_users: Set[int] | None = None, blocked_users: Set[int] = , required_roles: Set[int] | None = None, required_any_role: Set[int] | None = None, allowed_channels: Set[int] | None = None, blocked_channels: Set[int] = , allowed_categories: Set[int] | None = None, allowed_hours: Set[int] | None = None) -> None`: Every restriction of a command, filled by the decorators. Methods: `.to_api_dict()` [slash] - `IntegrationType`: Installation types: `GUILD_INSTALL`, `USER_INSTALL`. Values: GUILD_INSTALL, USER_INSTALL - `InteractionContext`: Usage contexts: `GUILD`, `BOT_DM`, `PRIVATE_CHANNEL`. Values: GUILD, BOT_DM, PRIVATE_CHANNEL - `Permissions`: Discord permission flags, up to `PIN_MESSAGES` and `BYPASS_SLOWMODE`. Values: CREATE_INSTANT_INVITE, KICK_MEMBERS, BAN_MEMBERS, ADMINISTRATOR, MANAGE_CHANNELS, MANAGE_GUILD, ADD_REACTIONS, VIEW_AUDIT_LOG, PRIORITY_SPEAKER, STREAM, VIEW_CHANNEL, SEND_MESSAGES, SEND_TTS_MESSAGES, MANAGE_MESSAGES, EMBED_LINKS, ATTACH_FILES, READ_MESSAGE_HISTORY, MENTION_EVERYONE, USE_EXTERNAL_EMOJIS, VIEW_GUILD_INSIGHTS, CONNECT, SPEAK, MUTE_MEMBERS, DEAFEN_MEMBERS, MOVE_MEMBERS, USE_VAD, CHANGE_NICKNAME, MANAGE_NICKNAMES, MANAGE_ROLES, MANAGE_WEBHOOKS, MANAGE_GUILD_EXPRESSIONS, USE_APPLICATION_COMMANDS, REQUEST_TO_SPEAK, MANAGE_EVENTS, MANAGE_THREADS, CREATE_PUBLIC_THREADS, CREATE_PRIVATE_THREADS, USE_EXTERNAL_STICKERS, SEND_MESSAGES_IN_THREADS, USE_EMBEDDED_ACTIVITIES, MODERATE_MEMBERS, VIEW_CREATOR_MONETIZATION_ANALYTICS, USE_SOUNDBOARD, CREATE_GUILD_EXPRESSIONS, CREATE_EVENTS, USE_EXTERNAL_SOUNDS, SEND_VOICE_MESSAGES, SET_VOICE_CHANNEL_STATUS, SEND_POLLS, USE_EXTERNAL_APPS, PIN_MESSAGES, BYPASS_SLOWMODE [slash] - `allowed_channels(*channel_ids: int) -> Callable`: Restricts the command to some channels. [slash] - `allowed_guilds(*guild_ids: int) -> Callable`: Restricts the command to some guilds. [slash] - `blocked_channels(*channel_ids: int) -> Callable`: Forbids the command in some channels. [slash] - `bot_has_permissions(**perms) -> Callable`: Requires bot permissions in the channel. - `check(check_func: Callable[[discord.Interaction], Awaitable[bool]]) -> Callable`: Adds a custom async check `(interaction) -> bool`. - `async check_permissions(interaction: discord.Interaction, config: PermissionConfig) -> tuple[bool, str | None]`: Checks every restriction. Returns `(allowed, message)`. [slash] - `contexts(*values: int) -> Callable`: Where the command can be used: guilds, DMs with the bot, private groups. [slash] - `default_permissions(**perms) -> Callable`: Hides the command from members lacking these permissions, directly in Discord. - `dm_only() -> Callable`: Command usable in direct messages only. [slash] - `guild_only() -> Callable`: Command usable in guilds only. - `has_permissions(**perms) -> Callable`: Requires user permissions in the channel: `@has_permissions(manage_messages=True)`. - `integration_types(*values: int) -> Callable`: Installation types: guild, user, or both. [slash] - `nsfw() -> Callable`: Command restricted to NSFW channels. - `owner_only(owner_ids: Set[int] | None = None) -> Callable`: Command restricted to the bot owners. - `require_roles(*role_ids: int, require_all: bool = False) -> Callable`: Requires one of the given roles, or all of them with `require_all=True`. - `time_restricted(hours: List[int]) -> Callable`: Restricts the command to some hours (UTC). [slash] - `user_installable() -> Callable`: Command installable by users and usable everywhere. ### Cooldowns - `class CooldownBucket(rate: int, per: float, type: CooldownType = CooldownType.USER, bucket_key: Callable[[discord.Interaction], str] | None = None) -> None`: Sliding window of a cooldown. `acquire()` checks and consumes in one step. Methods: `.acquire()`, `.check()`, `.trigger()`, `.reset()`, `.reset_all()`, `.retry_after()` [slash] - `class DynamicCooldown(rate: int = 1, per: float = 5.0, type: CooldownType = CooldownType.USER, bucket_key: Callable[[discord.Interaction], str] | None = None, per_func: Callable[[discord.Interaction], float] = lambda) -> None`: Cooldown whose duration is computed on every call. Methods: `.apply()`, `.acquire()`, `.check()`, `.trigger()`, `.reset()`, `.reset_all()`, `.retry_after()` - `class SharedCooldown(name: str, rate: int = 1, per: float = 5.0, type: CooldownType = CooldownType.USER, bucket_key: Callable[[discord.Interaction], str] | None = None) -> None`: Cooldown shared between several commands. Methods: `.apply()` - `CooldownType`: Cooldown scopes. Values: USER, CHANNEL, GUILD, MEMBER, GLOBAL, CATEGORY, ROLE, CUSTOM [slash] - `channel_cooldown(rate: int = 1, per: float = 5.0) -> Callable`: Per-channel cooldown. [slash] - `cooldown(rate: int = 1, per: float = 5.0, type: CooldownType = CooldownType.USER, bucket_key: Callable[[discord.Interaction], str] | None = None) -> Callable`: Rate-limits a command: `@cooldown(1, 5)` allows one use every 5 seconds per user. - `global_cooldown(rate: int = 1, per: float = 5.0) -> Callable`: Cooldown shared by everyone. [slash] - `guild_cooldown(rate: int = 1, per: float = 5.0) -> Callable`: Per-guild cooldown. - `member_cooldown(rate: int = 1, per: float = 5.0) -> Callable`: Per-member cooldown (user within a guild). [slash] - `user_cooldown(rate: int = 1, per: float = 5.0) -> Callable`: Per-user cooldown. ### Autocomplete - `class AutocompleteContext(interaction: discord.Interaction, value: str, option_name: str, focused: bool = True, options: Dict[str, Any] = ) -> None`: Autocomplete context: current input (`value`), option and other filled options. - `class AutocompleteRegistry()`: Internal registry of autocomplete functions. Methods: `.register()`, `.register_options()`, `.register_global()`, `.get_handler()`, `.handle()` [slash] - `autocomplete_handler(command: str | None = None, option: str | None = None) -> Callable`: Marks a function as the autocomplete of a command. [slash] - `chain(*handlers: Callable[..., Awaitable[List[Tuple[str, Any]]]]) -> Callable[..., Awaitable[List[Tuple[str, Any]]]]`: Combines several autocompletes, without duplicates. [slash] - `conditional(condition: Callable[[AutocompleteContext], bool], if_true: Callable[..., Awaitable[List[Tuple[str, Any]]]], if_false: Callable[..., Awaitable[List[Tuple[str, Any]]]]) -> Callable[..., Awaitable[List[Tuple[str, Any]]]]`: Picks an autocomplete depending on the context. [slash] - `filter_choices(choices: Sequence[Tuple[str, Any]], query: str, *, case_sensitive: bool = False, fuzzy: bool = False, max_results: int = 25) -> List[Tuple[str, Any]]`: Filters and ranks choices against the input: exact, prefix, contains, then fuzzy. [slash] - `from_coroutine(coro_func: Callable[..., Awaitable[List[str]]], *, cache_ttl: float = 0) -> Callable[..., Awaitable[List[Tuple[str, Any]]]]`: Autocomplete from an async function, with optional caching. [slash] - `from_dict(mapping: Dict[str, Any]) -> Callable[..., Awaitable[List[Tuple[str, Any]]]]`: Autocomplete from a `{label: value}` dict. - `from_list(items: List[str], *, value_transform: Callable[[str], Any] | None = None) -> Callable[..., Awaitable[List[Tuple[str, Any]]]]`: Autocomplete from a list of strings. ### Middlewares - `class Middleware(name: str, before: Callable[[SlashContext], Awaitable[bool | None]] | None = None, after: Callable[[SlashContext, Any, Exception | None], Awaitable[None]] | None = None, on_error: Callable[[SlashContext, Exception], Awaitable[bool | None]] | None = None, priority: int = 100, commands: List[str] | None = None, exclude_commands: List[str] | None = None) -> None`: Before, after and error hooks, filterable per command. Methods: `.should_apply()` [slash] - `class MiddlewareStack()`: Stack of middlewares sorted by priority. Methods: `.add()`, `.remove()`, `.run_before()`, `.run_after()`, `.run_error()` [slash] - `MiddlewarePhase`: Middleware execution phases. Values: BEFORE, AFTER, ERROR, SUCCESS [slash] - `analytics_middleware(*, track_func: Callable[[str, Dict[str, Any]], Awaitable[None]]) -> Middleware`: Sends one usage event per command to your function. [slash] - `error_handler_middleware(*, send_error_to_user: bool = True, error_message: str = 'An error occurred while processing your command.', log_errors: bool = True, on_error: Callable[[SlashContext, Exception], Awaitable[None]] | None = None) -> Middleware`: Global error handling with a message to the user. - `logging_middleware(*, log_func: Callable[[str], None] | None = None, include_options: bool = True, include_timing: bool = True) -> Middleware`: Logs every command, its options and its duration. - `maintenance_middleware(*, is_enabled: Callable[[], bool] = lambda, allowed_users: List[int] | None = None, message: str = 'The bot is currently under maintenance. Please try again...) -> Middleware`: Maintenance mode: blocks commands except for some users. [slash] - `ratelimit_middleware(*, max_commands_per_minute: int = 30, per: str = 'user') -> Middleware`: Global anti-spam: maximum commands per minute. [slash] - `timing_middleware(*, slow_threshold_ms: float = 3000, on_slow: Callable[[SlashContext, float], Awaitable[None]] | None = None) -> Middleware`: Reports commands slower than a threshold. [slash] ### Localization - `class Localization(default_locale: str = 'en-US')`: Translations for command names, descriptions and choices. Methods: `.load_from_dict()`, `.load_from_json()`, `.load_from_folder()`, `.get()`, `.t()`, `.localizations()`, `.command()`, `.option()`, `.choice()` - `class LocalizedString(default: str)`: Translated string built on the fly: `L("Bonjour").en_US("Hello")`. Methods: `.to_dict()` [slash] - `class TranslationSet(key: str, translations: Dict[str, str] = , default: str | None = None) -> None`: Translations of one key in several locales. Methods: `.get()`, `.to_api_dict()` [slash] - `create_common_localization() -> Localization`: `Localization` pre-filled with the common translations. [slash] - `L(default: str) -> LocalizedString`: Shortcut for `LocalizedString`. ### Sync - `class CommandSync(client: discord.Client)`: Fine-grained sync: targeted read, create, update and delete of commands. Methods: `.get_global_commands()`, `.get_guild_commands()`, `.bulk_overwrite_global()`, `.bulk_overwrite_guild()`, `.create_global_command()`, `.update_global_command()`, `.delete_global_command()`, `.create_guild_command()`, `.update_guild_command()`, `.delete_guild_command()`, `.sync_global()`, `.sync_guild()`, `.sync_tree()` [slash] - `class SyncResult(synced: int = 0, created: int = 0, updated: int = 0, deleted: int = 0, errors: List[str] = None) -> None`: Sync report: created, updated, deleted, errors. [slash] - `SyncMode`: Sync strategies. Values: FULL, SMART, APPEND [slash] ### Errors - `AutocompleteError(option_name: str, reason: str)`: An autocomplete failed. [slash] - `BotMissingPermissions(missing: List[str], command_name: str)`: Missing bot permissions. [slash] - `CheckFailure(check_name: str, message: str | None = None)`: A `@check` failed. [slash] - `CommandDisabled(command_name: str, reason: str | None = None)`: Command disabled. [slash] - `CommandNotFound(command_name: str)`: Unknown command. [slash] - `CommandOnCooldown(cooldown_type: str, retry_after: float, command_name: str)`: Command on cooldown; `retry_after` gives the wait in seconds. - `InvalidOption(option_name: str, reason: str)`: Option value rejected by validation. [slash] - `MaxConcurrency(command_name: str, max_concurrent: int, per: str)`: Too many simultaneous runs. [slash] - `MiddlewareError(middleware_name: str, reason: str)`: A middleware failed. [slash] - `MissingPermissions(missing: List[str], command_name: str)`: Missing user permissions. [slash] - `NotInGuild(command_name: str)`: Command restricted to guilds. [slash] - `NotOwner()`: Command restricted to owners. [slash] - `NSFWChannelRequired(command_name: str)`: Command restricted to NSFW channels. [slash] - `SlashCommandError()`: Base of every slash command error. ### Other - `COMMON_TRANSLATIONS`: Common ready-made translations. [slash] - `LOCALES`: Locale codes supported by Discord. [slash]