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 optionMembers
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 attachmentgetBooleanOption() → {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 booleangetChannelOption() → {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 channelgetIntegerOption() → {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 integergetMentionableOption() → {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 mentionablegetNumberOption() → {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 numbergetOptions() → {Array.<object>}
Get the interaction options
Returns:
- Type:
- Array.<object>
Example
const options = interaction.options.getOptions(); // returns the optionsgetRoleOption() → {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 rolegetStringOption() → {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 stringgetSubCommand() → {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 subcommandgetSubCommandGroup() → {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 groupgetUserOption() → {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