Resources¶
command
¶
GlobalCommand
dataclass
¶
Bases: BaseResource
flowchart TD
scurrypy.resources.command.GlobalCommand[GlobalCommand]
scurrypy.resources.base_resource.BaseResource[BaseResource]
scurrypy.resources.base_resource.BaseResource --> scurrypy.resources.command.GlobalCommand
click scurrypy.resources.command.GlobalCommand href "" "scurrypy.resources.command.GlobalCommand"
click scurrypy.resources.base_resource.BaseResource href "" "scurrypy.resources.base_resource.BaseResource"
Represents a global command.
application_id: Snowflake
instance-attribute
¶
Application ID of the commands.
fetch
async
¶
Fetches a command object.
Parameters:
-
command_id(int) –ID of the command to fetch
Returns:
-
ApplicationCommandModel–queried application command
fetch_all
async
¶
Fetches ALL global commands.
Returns:
-
list[ApplicationCommandModel]–queried list of application commands
create
async
¶
Add a 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:
-
command(SlashCommandPart | UserCommandPart | MessageCommandPart) –command to register
Returns:
-
ApplicationCommandModel–created command
edit
async
¶
Edit a command.
Parameters:
-
command_id(Snowflake) –ID of command to edit
-
options(EditGlobalCommandParams, default:{}) –command fields to edit
Returns:
-
ApplicationCommandModel–updated application command
bulk_overwrite
async
¶
Takes a list of application commands, overwriting existing commands 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:
-
commands(list[SlashCommandPart | UserCommandPart | MessageCommandPart]) –commands to register
Returns:
-
list[ApplicationCommandModel]–created application commands
GuildCommand
dataclass
¶
Bases: BaseResource
flowchart TD
scurrypy.resources.command.GuildCommand[GuildCommand]
scurrypy.resources.base_resource.BaseResource[BaseResource]
scurrypy.resources.base_resource.BaseResource --> scurrypy.resources.command.GuildCommand
click scurrypy.resources.command.GuildCommand href "" "scurrypy.resources.command.GuildCommand"
click scurrypy.resources.base_resource.BaseResource href "" "scurrypy.resources.base_resource.BaseResource"
Represents a guild command.
application_id: Snowflake
instance-attribute
¶
Application ID of the commands.
guild_id: Snowflake
instance-attribute
¶
Guild ID of command.
fetch
async
¶
Fetches the command object.
Parameters:
-
command_id(int) –ID of command to fetch
Returns:
-
ApplicationCommandModel–queried application command
fetch_all
async
¶
Fetches ALL guild commands.
Returns:
-
list[ApplicationCommandModel]–queried list of application commands
create
async
¶
Add a 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:
-
command(SlashCommandPart | UserCommandPart | MessageCommandPart) –command to register
Returns:
-
ApplicationCommandModel–created command
edit
async
¶
Edit a command.
Parameters:
-
command_id(Snowflake) –ID of command to edit
-
options(EditGuildCommandParams, default:{}) –command fields to edit
Returns:
-
ApplicationCommandModel–updated application command
bulk_overwrite
async
¶
Takes a list of application commands, overwriting existing commands list for this guild.
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:
-
commands(list[SlashCommandPart | UserCommandPart | MessageCommandPart]) –commands to register
Returns:
-
list[ApplicationCommandModel]–created application commands