Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MessageRequest<Body>

Type parameters

  • Body = unknown

Hierarchy

Index

Constructors

  • new MessageRequest<Body>(message: Message<boolean>): MessageRequest<Body>

Properties

appId: null | string
body: Body

Arguments and options passed from the command

channel: null | TextBasedChannel
channelId: null | string
client: null | Client<boolean>
command: [command?: string, subcommandGroup?: string, subcommand?: string] = []

Command details. Note that for message commands, positional arguments are inserted even if they may not be subcommands or subcommand groups.

example
// A command that looks like this
const input = "!myCommand arg1 arg2 arg3"

// Will output this
const output = {
body: {
_: ["arg1", "arg2", "arg4"],
},
command: ["myCommand", "arg1", "arg2"],
}

Because of this ambiguity, the decision of how to treat this behaviour is up to the programmer later on. Note that this behaviour is properly handled by discord-express.

createdAt: Date
createdTimestamp: number
guild: null | Guild
guildId: null | string
id: string
interaction?: undefined = undefined
isInteractionRequest: false = false
isMessageRequest: true = true
member: null | GuildMember
message: Message<boolean>
metadata: {} = {}

Extra metadata that can be stored for any purpose

Type declaration

  • [key: string]: unknown
requestType: "message" = ...
startAt: Date = ...
trigger: Message<boolean>

What triggered the command. In this case, it's a message

type: "DEFAULT" | "RECIPIENT_ADD" | "RECIPIENT_REMOVE" | "CALL" | "CHANNEL_NAME_CHANGE" | "CHANNEL_ICON_CHANGE" | "CHANNEL_PINNED_MESSAGE" | "GUILD_MEMBER_JOIN" | "USER_PREMIUM_GUILD_SUBSCRIPTION" | "USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1" | "USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2" | "USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3" | "CHANNEL_FOLLOW_ADD" | "GUILD_DISCOVERY_DISQUALIFIED" | "GUILD_DISCOVERY_REQUALIFIED" | "GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING" | "GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING" | "THREAD_CREATED" | "REPLY" | "APPLICATION_COMMAND" | "THREAD_STARTER_MESSAGE" | "GUILD_INVITE_REMINDER" | "CONTEXT_MENU_COMMAND"
user: User

User who triggered the request

alias

author

Accessors

  • get author(): User
  • Author of the request

    alias

    user

    Returns User

Generated using TypeDoc