Skip to content

Command Resource

Note

The following classes come from the scurrypy.resources.command module.


GuildCommand dataclass

Bases: Command

Represents a guild command.

guild_id: Optional[int] instance-attribute

Guild ID of command.

context: Any instance-attribute

Associated user data.

application_id: int instance-attribute

Application ID of the commands.

fetch async

Fetches the command object.

Parameters:

  • command_id (int) –

    ID of command to fetch

Returns:

fetch_all async

Fetches ALL guild commands.

Returns:

create async

Add command to the client.

Danger

Creating a command with the same name as an existing command in the same scope will overwrite the old command.

Parameters:

Returns:

edit async

Edit a command.

Parameters:

  • command_id (int) –

    ID of command to edit

  • options (EditGuildCommandParams, default: {} ) –

    command fields to edit

Returns:

delete async

Delete a command.

Parameters:

  • command_id (int) –

    ID of command to delete

bulk_overwrite async

Takes a list of application commands, overwriting the existing global or guild command list for this application.

Warning

Commands that do not already exist will count toward daily application command create limits.

Danger

This will overwrite all types of application commands: slash commands, user commands, and message commands.

Parameters:

Returns:


GlobalCommand dataclass

Bases: Command

context: Any instance-attribute

Associated user data.

application_id: int instance-attribute

Application ID of the commands.

fetch async

Fetches a command object.

Returns:

fetch_all async

Fetches ALL global commands.

Returns:

create async

Add command to the client.

Danger

Creating a command with the same name as an existing command in the same scope will overwrite the old command.

Parameters:

Returns:

edit async

Edit this command.

Parameters:

  • command_id (int) –

    ID of command to edit

  • options (EditGlobalCommandParams, default: {} ) –

    command fields to edit

Returns:

delete async

Delete a command.

Parameters:

  • command_id (int) –

    ID of the command to delete

bulk_overwrite async

Takes a list of application commands, overwriting the existing global command list for this application.

Warning

Commands that do not already exist will count toward daily application command create limits.

Danger

This will overwrite all types of application commands: slash commands, user commands, and message commands.

Parameters:

Returns:


Command dataclass

Bases: BaseResource

Represents a Discord command.

application_id: int instance-attribute

Application ID of the commands.

context: Any instance-attribute

Associated user data.