DiscordSlashCommand

Inherits: DiscordApplicationCommandInteraction < DiscordRepliableInteraction < DiscordInteraction < DiscordEntity < Reference < Object

Description

A chat input based commad interaction, supports multiple options.

Methods

return type signature
Variant get_option ( String name, Variant default=null, int expect_type=0 )
String get_string_option ( String name, String default="" )
int get_integer_option ( String name, int default=0 )
float get_number_option ( String name, float default=0 )
bool get_boolean_option ( String name, bool default=false )
User get_user_option ( String name, User default=null )
Channel get_channel_option ( String name, Channel default=null )
Guild.Role get_role_option ( String name, Guild.Role default=null )
MentionableEntity get_mentionable_option ( String name, MentionableEntity default=null )
MessageAttachment get_attachment_option ( String name, MessageAttachment default=null )
int get_options_count ( )
bool has_option ( String name )

Constants

Method Descriptions

  • Variant get_option ( String name, Variant default=null, int expect_type=0 )

    Gets an option by name, returns default if not found. Set expect_type to a DiscordApplicationCommandOption.Option value to restric the return type. Variant


  • String get_string_option ( String name, String default="" )

    Gets a string option by name.


  • int get_integer_option ( String name, int default=0 )

    Gets a integer option by name.


  • float get_number_option ( String name, float default=0 )

    Gets a number option by name.


  • bool get_boolean_option ( String name, bool default=false )

    Gets a boolean option by name.


  • User get_user_option ( String name, User default=null )

    Gets a user option by name.


  • Channel get_channel_option ( String name, Channel default=null )

    Gets a channel option by name.


  • Guild.Role get_role_option ( String name, Guild.Role default=null )

    Gets a role option by name.


  • MentionableEntity get_mentionable_option ( String name, MentionableEntity default=null )

    Gets a mentionable entity (User or Guild.Role) option by name.


  • MessageAttachment get_attachment_option ( String name, MessageAttachment default=null )

    Gets an attachement option by name.


  • int get_options_count ( )

    Gets the number of options inputed by the user.


  • bool has_option ( String name )

    Checks if option by name exists.