discord-interactions

Application Command Models

class interactions.models.command.Choice(**kwargs)

A class object representing the choice of an option.

Note

value allows float as a passable value type, whereas it’s supposed to be double.

Variables
  • name (str) – The name of the choice.

  • value (typing.Union[str, int, float]) – The returned value of the choice.

class interactions.models.command.Option(**kwargs)

A class object representing the option of an application command.

Note

options is only present for when a subcommand has been established.

Variables
  • type (interactions.enums.OptionType) – The type of option.

  • name (str) – The name of the option.

  • description (str) – The description of the option.

  • focused (bool) – Whether the option is currently being autocompleted or not.

  • required (bool) – Whether the option has to be filled out.

  • value (typing.Optional[str]) – The value that’s currently typed out, if autocompleting.

  • choices (typing.Optional[typing.List[interactions.models.Choice]]) – The list of choices to select from.

  • options (typing.Optional[list]) – The list of subcommand options included.

  • channel_type (typing.Optional[typing.List[interactions.api.models.channel.ChannelType]) – Restrictive shown channel types, if given.

class interactions.models.command.Permission(**kwargs)

A class object representing the permission of an application command.

Variables
  • id (int) – The ID of the permission.

  • type (interactions.enums.PermissionType) – The type of permission.

  • permission (bool) – The permission state. True for allow, False for disallow.

class interactions.models.command.ApplicationCommand(**kwargs)

A class object representing all types of commands.

Variables
  • id (typing.Optional[int]) – The ID of the application command.

  • type (typing.Optional[int]) – The application command type.

  • application_id (typing.Optional[int]) – The general application ID of the command itself.

  • guild_id (int) – The guild ID of the application command.

  • name (str) – The name of the application command.

  • description (typing.Optional[str]) – The description of the application command.

  • options (typing.Optional[typing.List[interactions.models.Option]]) – The “options”/arguments of the application command.

  • default_permission (typing.Optional[bool]) – The default permission accessibility state of the application command.

  • version (int) – The Application Command version autoincrement identifier.