Constructor
new InteractionOptions() → {InteractionOptions}
Returns:
- Type:
- InteractionOptions
Example
const subCommandOption = interaction.options.getSubCommand(); // returns the subcommand option
const subCommandGroupOption = interaction.options.getSubCommandGroup(); // returns the subcommand group option
const stringOption = interaction.options.getStringOption("optionName"); // returns the string option
const integerOption = interaction.options.getIntegerOption("optionName"); // returns the integer option
const booleanOption = interaction.options.getBooleanOption("optionName"); // returns the boolean option
const userOption = interaction.options.getUserOption("optionName"); // returns the user option
const memberOption = interaction.options.getMemberOption("optionName"); // returns the member option
const channelOption = interaction.options.getChannelOption("optionName"); // returns the channel option
const roleOption = interaction.options.getRoleOption("optionName"); // returns the role option
const numberOption = interaction.options.getNumberOption("optionName"); // returns the number option
const mentionableOption = interaction.options.getMentionableOption("optionName"); // returns the mentionable option
Members
data :Array.<object>
the interaction option data
Type:
- Array.<object>
Methods
getAttachmentOption() → {InteractionOptionsType.structure}
Get the interaction option "Attachment"
Name | Type | Description |
---|---|---|
name | string | The name of the option |
Returns:
- Type:
- InteractionOptionsType.
structure
Example
const attachmentOption = interaction.options.getAttachmentOption("optionName"); // returns the attachment
getBooleanOption() → {InteractionOptionsType.structure}
Get the interaction option "Boolean"
Name | Type | Description |
---|---|---|
name | string | The name of the option |
Returns:
- Type:
- InteractionOptionsType.
structure
Example
const booleanOption = interaction.options.getBooleanOption("optionName"); // returns the boolean
getChannelOption() → {InteractionOptionsType.structure}
Get the interaction option "Channel"
Name | Type | Description |
---|---|---|
name | string | The name of the option |
Returns:
- Type:
- InteractionOptionsType.
structure
Example
const channelOption = interaction.options.getChannelOption("optionName"); // returns the channel
getIntegerOption() → {InteractionOptionsType.structure}
Get the interaction option "String"
Name | Type | Description |
---|---|---|
name | string | The name of the option |
Returns:
- Type:
- InteractionOptionsType.
structure
Example
const integerOption = interaction.options.getIntegerOptionOption("optionName"); // returns the integer
getMentionableOption() → {InteractionOptionsType.structure}
Get the interaction option "Mentionable"
Name | Type | Description |
---|---|---|
name | string | The name of the option |
Returns:
- Type:
- InteractionOptionsType.
structure
Example
const mentionableOption = interaction.options.getMentionableOption("optionName"); // returns the mentionable
getNumberOption() → {InteractionOptionsType.structure}
Get the interaction option "Number"
Name | Type | Description |
---|---|---|
name | string | The name of the option |
Returns:
- Type:
- InteractionOptionsType.
structure
Example
const numberOption = interaction.options.getNumberOption("optionName"); // returns the number
getOptions() → {Array.<object>}
Get the interaction options
Returns:
- Type:
- Array.<object>
Example
const options = interaction.options.getOptions(); // returns the options
getRoleOption() → {InteractionOptionsType.structure}
Get the interaction option "Role"
Name | Type | Description |
---|---|---|
name | string | The name of the option |
Returns:
- Type:
- InteractionOptionsType.
structure
Example
const roleOption = interaction.options.getRoleOption("optionName"); // returns the role
getStringOption() → {InteractionOptionsType.structure}
Get the interaction option "String"
Name | Type | Description |
---|---|---|
name | string | The name of the option |
Returns:
- Type:
- InteractionOptionsType.
structure
Example
const stringOption = interaction.options.getStringOption("optionName"); // returns the string
getSubCommand() → {InteractionOptionsType.structure}
Get the interaction option "Sub Command"
Name | Type | Description |
---|---|---|
name | string | The name of the option |
Returns:
- Type:
- InteractionOptionsType.
structure
Example
const subCommandOption = interaction.options.getSubCommand(); // returns the subcommand
getSubCommandGroup() → {InteractionOptionsType.structure}
Get the interaction option "Sub Command Group"
Name | Type | Description |
---|---|---|
name | string | The name of the option |
Returns:
- Type:
- InteractionOptionsType.
structure
Example
const subCommandGroupOption = interaction.options.getSubCommandGroup(); // returns the subcommand group
getUserOption() → {InteractionOptionsType.structure}
Get the interaction option "User"
Name | Type | Description |
---|---|---|
name | string | The name of the option |
Returns:
- Type:
- InteractionOptionsType.
structure
Example
const userOption = interaction.options.getUserOption("optionName"); // returns the user