Outgoing Models¶
To import these models
from dispike.creating.models.options import <Object>
Warning
Version >=v0.5.7a adds support for VSCode to auto-complete attributes when creating these models.
¶
CommandChoice
pydantic-model
¶
Represents a key-value command choice.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Name of the choice. |
value |
str |
Value of the choice. |
CommandOption
pydantic-model
¶
Represents a standard command option (not a subcommand).
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Name of the option. |
description |
str |
Description of the option. |
type |
OptionTypes |
The option type. |
required |
bool |
Whether or not this option is required. |
choices |
Union[List[dict], List[CommandChoice]] |
Possible choices for this option for the user to pick from. |
options |
Union[List[CommandChoice], List] |
If the option is a subcommand or subcommand group type, this nested options will be the parameters. |
CommandTypes
¶
Easy access to command types.
Attributes:
Name | Type | Description |
---|---|---|
SLASH |
int |
Represents Type 1 |
USER |
int |
Represents Type 2 |
MESSAGE |
int |
Represents Type 3 |
DiscordCommand
pydantic-model
¶
Represents a discord command.
Attributes:
Name | Type | Description |
---|---|---|
id |
int |
Id of this command. |
name |
str |
Name of this command. |
description |
str |
Description of this command. |
options |
List[Union[SubcommandOption, CommandOption]] |
Options for this command. |
default_permission |
boolean |
whether the command is enabled by default when the app is added to a guild. Defaults to True. |
type |
Union[CommandTypes, int] |
The type of command. This defaults to SLASH |
OptionTypes
¶
Easy access to option types.
Attributes:
Name | Type | Description |
---|---|---|
BOOLEAN |
int |
Represents Type 5 |
CHANNEL |
int |
Represents Type 7 |
INTEGER |
int |
Represents Type 4 |
ROLE |
int |
Represents Type 8 |
STRING |
int |
Represents Type 3 |
SUB_COMMAND |
int |
Represents Type 1 |
SUB_COMMAND_GROUP |
int |
Represents Type 2 |
USER |
int |
Represents Type 6 |
MENTIONABLE |
int |
Represents Type 9 |
NUMBER |
int |
Represents Type 10 |
SubcommandOption
pydantic-model
¶
Represents a subcommand group usually you would put this as an option in a DiscordCommand
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Name of this group. |
description |
str |
Description of this group. |
options |
List[CommandOption] |
Options for this group. |