discord-interactions.py

CommandSync

Classe

Synchronisation fine : lecture, création, mise à jour et suppression ciblées des commandes.

from discord_interactions.slash import CommandSync

Constructeur

CommandSync(client: discord.Client)
NomTypeDéfautDescription
clientdiscord.Clientrequis

Propriétés

NomTypeDescription
application_idint

Méthodes

get_global_commands

async def get_global_commands() -> List[Dict[str, Any]]

get_guild_commands

async def get_guild_commands(guild_id: int) -> List[Dict[str, Any]]

bulk_overwrite_global

async def bulk_overwrite_global(commands: List[Dict[str, Any]]) -> List[Dict[str, Any]]

bulk_overwrite_guild

async def bulk_overwrite_guild(    guild_id: int,    commands: List[Dict[str, Any]],) -> List[Dict[str, Any]]

create_global_command

async def create_global_command(command: Dict[str, Any]) -> Dict[str, Any]

update_global_command

async def update_global_command(    command_id: int,    command: Dict[str, Any],) -> Dict[str, Any]

delete_global_command

async def delete_global_command(command_id: int) -> None

create_guild_command

async def create_guild_command(guild_id: int, command: Dict[str, Any]) -> Dict[str, Any]

update_guild_command

async def update_guild_command(    guild_id: int,    command_id: int,    command: Dict[str, Any],) -> Dict[str, Any]

delete_guild_command

async def delete_guild_command(guild_id: int, command_id: int) -> None

sync_global

async def sync_global(    commands: List[Dict[str, Any]],    mode: SyncMode = SyncMode.FULL,) -> SyncResult

sync_guild

async def sync_guild(    guild_id: int,    commands: List[Dict[str, Any]],    mode: SyncMode = SyncMode.FULL,) -> SyncResult

sync_tree

async def sync_tree(    manager: SlashCommandManager,    guilds: List[int] | None = None,    mode: SyncMode = SyncMode.FULL,) -> Dict[int | None, SyncResult]

Tape un nom : create_button, ModalBuilder, cooldown.