Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents CommandInteraction or Message which contains command.

Hierarchy

  • CommandMessage

Index

Constructors

Properties

_client: Client<boolean> = ...
_command: string = ...
_interaction: CommandInteraction<CacheType> = ...
_interactionReplied: boolean = false
_message: Message<boolean> = ...
_options: string[] = ...
_rawOptions: string = ...
_responseMessage: ResponseMessage = ...
isMessage: boolean = false

Accessors

  • get attachments(): Collection<string, MessageAttachment>
  • the attatchment of this command message. If this was created from CommandInteraction, this will always return empty collection.

    Returns Collection<string, MessageAttachment>

  • get author(): User
  • get channel(): TextBasedChannel
  • get channelId(): string
  • get command(): string
  • get content(): string
  • get createdAt(): Date
  • get createdTimestamp(): number
  • get guild(): Guild
  • get id(): string
  • get member(): GuildMember
  • get options(): string[]
  • get rawOptions(): string
  • get reactions(): ReactionManager
  • the reactions of this command message If this was created from CommandInteraction, this will always return null.

    Returns ReactionManager

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

    Returns string

Methods

  • Respond to the command You can call this once

    Parameters

    • options: string | MessageOptions

      message content

    Returns Promise<ResponseMessage>

    response message bound to this command message

  • createFromInteraction(interaction: CommandInteraction<CacheType>): CommandMessage
  • Initialize this from interaction

    Parameters

    • interaction: CommandInteraction<CacheType>

      Interaction that contains command

    Returns CommandMessage

    new CommandMessage instance

  • createFromMessage(message: Message<boolean>, prefixLength?: number): CommandMessage
  • Initialize this from Message

    Parameters

    • message: Message<boolean>

      Message an user sent that contains command

    • prefixLength: number = 1

    Returns CommandMessage

    new CommandMessage instance

  • createFromMessageWithParsed(message: Message<boolean>, command: string, options: string[], rawOptions: string): CommandMessage
  • parseCommand(cmd: string, prefixLength: number, textNormalizer: (text: string) => string): { command: string; options: string[]; rawOptions: string }
  • Parameters

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

          • text: string

          Returns string

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

    • command: string
    • options: string[]
    • rawOptions: string
  • resolveCommandMessage(content: string, prefixLength: number, textNormalizer?: (text: string) => 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) => string = ...
        • (text: string): 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