Class InteractionOptionsWrapper

A wrapper for interaction options.

Hierarchy

  • InteractionOptionsWrapper

Constructors

Properties

_getOption: any

The raw options from Discord.

The resolved data for this options instance.

Methods

  • Get an attachment option value.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present or the attachment cannot be found.

    Returns undefined | Attachment

  • Parameters

    • name: string
    • required: true

    Returns Attachment

  • Get an attachment option.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | InteractionOptionsAttachment

  • Parameters

    • name: string
    • required: true

    Returns InteractionOptionsAttachment

  • Get a boolean option value.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | boolean

  • Parameters

    • name: string
    • required: true

    Returns boolean

  • Get a boolean option.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | InteractionOptionsBoolean

  • Parameters

    • name: string
    • required: true

    Returns InteractionOptionsBoolean

  • Get a channel option value.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present or the channel cannot be found.

    Returns undefined | InteractionResolvedChannel

  • Parameters

    • name: string
    • required: true

    Returns InteractionResolvedChannel

  • Get a channel option.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | InteractionOptionsChannel

  • Parameters

    • name: string
    • required: true

    Returns InteractionOptionsChannel

  • Get a channel option's complete channel. This will only succeed if the channel is cached. If the channel is private and isn't cached, an InteractionResolvedChannel instance will still be returned.

    Type Parameters

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present or the channel cannot be found.

    Returns undefined | T

  • Type Parameters

    Parameters

    • name: string
    • required: true

    Returns T

  • Get the focused option (in an autocomplete interaction).

    Type Parameters

    Parameters

    • Optional required: false

      If true, an error will be thrown if no focused option is present.

    Returns undefined | T

  • Type Parameters

    Parameters

    • required: true

    Returns T

  • Get an integer option value.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | number

  • Parameters

    • name: string
    • required: true

    Returns number

  • Get an integer option.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | InteractionOptionsInteger

  • Parameters

    • name: string
    • required: true

    Returns InteractionOptionsInteger

  • Get a user option value (as a member).

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present, or if the member cannot be found.

    Returns undefined | Member

  • Parameters

    • name: string
    • required: true

    Returns Member

  • Get a mentionable option value (channel, user, role).

    Type Parameters

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present, or if the value cannot be found.

    Returns undefined | T

  • Type Parameters

    Parameters

    • name: string
    • required: true

    Returns T

  • Get a mentionable option.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | InteractionOptionsMentionable

  • Parameters

    • name: string
    • required: true

    Returns InteractionOptionsMentionable

  • Get a number option value.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | number

  • Parameters

    • name: string
    • required: true

    Returns number

  • Get a number option.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | InteractionOptionsNumber

  • Parameters

    • name: string
    • required: true

    Returns InteractionOptionsNumber

  • Get the options received in this interaction, excluding subcommands and subcommand groups.

    Returns InteractionOptionsWithValue[]

  • Get a role option value.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present, or if the role cannot be found.

    Returns undefined | Role

  • Parameters

    • name: string
    • required: true

    Returns Role

  • Get a role option.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | InteractionOptionsRole

  • Parameters

    • name: string
    • required: true

    Returns InteractionOptionsRole

  • Get a string option value.

    Type Parameters

    • T extends string = string

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | T

  • Type Parameters

    • T extends string = string

    Parameters

    • name: string
    • required: true

    Returns T

  • Get a string option.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | InteractionOptionsString

  • Parameters

    • name: string
    • required: true

    Returns InteractionOptionsString

  • If present, returns the top level subcommand. This will return an array of the subcommand name, and subcommand group name, if applicable.

    Type Parameters

    Parameters

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | T

  • Type Parameters

    Parameters

    • required: true

    Returns T

  • Get a user option value.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present, or if the user cannot be found.

    Returns undefined | User

  • Parameters

    • name: string
    • required: true

    Returns User

  • Get a user option.

    Parameters

    • name: string

      The name of the option.

    • Optional required: false

      If true, an error will be thrown if the option is not present.

    Returns undefined | InteractionOptionsUser

  • Parameters

    • name: string
    • required: true

    Returns InteractionOptionsUser

Generated using TypeDoc