Options
All
  • Public
  • Public/Protected
  • All
Menu

Class InteractionRequest<Body>

Type parameters

  • Body = unknown

Hierarchy

Index

Constructors

  • new InteractionRequest<Body>(interaction: CommandInteraction<CacheType>): InteractionRequest<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: CommandInteraction<CacheType>
isInteractionRequest: true = true
isMessageRequest: false = false
member: null | GuildMember | APIInteractionGuildMember
message?: undefined = undefined
metadata: {} = {}

Extra metadata that can be stored for any purpose

Type declaration

  • [key: string]: unknown
requestType: "interaction" = ...
startAt: Date = ...
trigger: CommandInteraction<CacheType>

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

type: "APPLICATION_COMMAND" | "PING" | "MESSAGE_COMPONENT" | "APPLICATION_COMMAND_AUTOCOMPLETE"
user: User

User who triggered the request

alias

author

Accessors

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

    alias

    user

    Returns User

Generated using TypeDoc