A wrapper for interaction options.

Hierarchy

  • InteractionOptionsWrapper

Constructors

Properties

The raw options from Discord.

Methods

  • 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 channel option value (id).

    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 | string

  • Parameters

    • name: string
    • required: true

    Returns string

  • 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 | number

  • Parameters

    • name: string
    • required: true

    Returns number

  • Get a mentionable option (id).

    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 | string

  • Parameters

    • name: string
    • required: true

    Returns string

  • 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 role option value (id).

    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 | string

  • Parameters

    • name: string
    • required: true

    Returns string

  • Get a role option value (role).

    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 string option.

    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

  • If present, returns the top level subcommand. This only goes one level deep, to get the subcommand of a subcommandgroup, you must call this twice in a ro.

    Parameters

    • Optional required: false

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

    Returns undefined | [subcommand: string] | [subcommandGroup: string, subcommand: string]

  • Parameters

    • required: true

    Returns [subcommand: string] | [subcommandGroup: string, subcommand: string]

  • Get a user option value (id).

    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 | string

  • Parameters

    • name: string
    • required: true

    Returns string

  • Get a user option value (user).

    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