Represents CommandInteraction or Message which contains command.

Hierarchy

  • CommandMessage

Constructors

Properties

_client: default<ClientEvents> = ...
_command: string = ...
_interaction: null | default<AnyTextableGuildChannel, ApplicationCommandTypes> | default<any, AnyTextableGuildChannel> | default<AnyTextableGuildChannel> = null
_interactionOption: null | InteractionOptions[] = null
_interactionReplied: boolean = false
_message: null | default<AnyTextableGuildChannel> = null
_options: string[] = ...
_rawOptions: string = ...
_responseMessage: ResponseMessage = ...
isMessage: boolean = false

Accessors

  • get attachments(): default<RawAttachment, default, []> | default[]
  • the attatchment of this command message. If this was created from CommandInteraction, this will always return empty array.

    Returns default<RawAttachment, default, []> | default[]

  • get author(): default
  • the author of this command message

    Returns default

  • get channel(): AnyTextableGuildChannel
  • the channel of this command message

    Returns AnyTextableGuildChannel

  • get channelId(): string
  • the channel id of this command message

    Returns string

  • get content(): string
  • the content of this command message

    Returns string

  • get createdAt(): Date
  • the date time of this command message

    Returns Date

  • get createdTimestamp(): Date
  • the timestamp of this command message

    Returns Date

  • get member(): default
  • the memeber of this command message

    Returns default

  • get options(): string[]
  • Command arguments which was resolved

    Returns string[]

  • get reactions(): null | MessageReaction[]
  • the reactions of this command message If this was created from CommandInteraction, this will always return null.

    Returns null | MessageReaction[]

  • get url(): null | string
  • the url of this command message If this was created from CommandInteraction, this will always return null.

    Returns null | string

Methods

  • Initialize this from command interaction.

    Parameters

    • interaction: default<AnyTextableGuildChannel, ApplicationCommandTypes>

      CommandInteraction that contains command.

    Returns CommandMessage

    Created CommandMessage object.

  • Initialize this from component interaction.

    Parameters

    • interaction: default<any, AnyTextableGuildChannel>

      ComponentInteraction that will be treated as a command.

    • command: string

      The command string that the interaction intends to execute.

    • options: string[]

      The parsed arguments of the command bound to the interaction.

    • rawOptions: string

      The raw arguments text of the command bound to the interaction.

    Returns CommandMessage

  • Initialize this from modal-submit interaction.

    Parameters

    • interaction: default<AnyTextableGuildChannel>

      ModalSubmitInteraction that will be treated as a command.

    • command: string

      The command string that the interaction intends to execute.

    • options: string[]

      The parsed arguments of the command bound to the interaction.

    • rawOptions: string

      The raw arguments text of the command bound to the interaction.

    Returns CommandMessage

  • Initialize this from Message

    Parameters

    • message: default<AnyTextableGuildChannel>

      Message an user sent that contains command

    • prefixLength: number = 1

    Returns CommandMessage

    new CommandMessage instance

  • Create and initialize a new CommandMessage object based on Message, with given pre-parsed options.

    Parameters

    • message: default<AnyTextableGuildChannel>

      The Message object that should be treated as a command.

    • command: string

      The command string that the Message indicates.

    • options: string[]

      The command arguments that the Message indicates.

    • rawOptions: string

      The raw command arguments text that the Message indicates.

    Returns CommandMessage

    New CommandMessage object.

  • Parameters

    • cmd: string
    • prefixLength: number
    • textNormalizer: ((text) => string)
        • (text): string
        • Parameters

          • text: string

          Returns string

    Returns {
        command: string;
        options: string[];
        rawOptions: string;
    }

    • command: string
    • options: string[]
    • rawOptions: string
  • Reslolve command and arguments from message content

    Parameters

    • content: string

      message content

    • prefixLength: number

      prefix length

    • textNormalizer: ((text) => string) = ...
        • (text): string
        • Parameters

          • text: string

          Returns string

    Returns {
        command: string;
        options: string[];
        rawOptions: string;
    }

    object contains resolved command, parsed arguments and raw argument.

    • command: string
    • options: string[]
    • rawOptions: string

Generated using TypeDoc