Carbon
CoreClasses

CommandInteraction

Represents a command interaction

Extends

Constructors

new CommandInteraction()

new CommandInteraction(client, data, defaults): CommandInteraction

Parameters

ParameterType
clientClient
dataAPIApplicationCommandInteraction
defaultsInteractionDefaults

Returns

CommandInteraction

Overrides

BaseInteraction.constructor

Properties

PropertyTypeDefault valueDescriptionInherited from
_deferredbooleanfalseInternal Whether the interaction is deferred alreadyBaseInteraction._deferred
clientClientundefined-BaseInteraction.client
optionsOptionsHandlerundefinedThis is the options of the commands, parsed from the interaction data. It will not have any options in it if the command is not a ChatInput command.-
rawDataAPIApplicationCommandInteractionundefinedThe raw data of the interactionBaseInteraction.rawData
typeInteractionTypeundefinedThe type of interactionBaseInteraction.type
userIdundefined | stringundefinedThe user who sent the interactionBaseInteraction.userId

Accessors

channel

get channel(): null | GuildCategoryChannel<false> | DmChannel<false> | GroupDmChannel<false> | GuildTextChannel<false> | GuildVoiceChannel<false> | GuildAnnouncementChannel<false> | GuildThreadChannel<ThreadChannelType, false> | GuildStageChannel<false> | GuildForumChannel<false> | GuildMediaChannel

Returns

null | GuildCategoryChannel<false> | DmChannel<false> | GroupDmChannel<false> | GuildTextChannel<false> | GuildVoiceChannel<false> | GuildAnnouncementChannel<false> | GuildThreadChannel<ThreadChannelType, false> | GuildStageChannel<false> | GuildForumChannel<false> | GuildMediaChannel

Inherited from

BaseInteraction.channel


embeds

get embeds(): null | Embed[]

Returns

null | Embed[]

Inherited from

BaseInteraction.embeds


guild

get guild(): null | Guild<true>

Returns

null | Guild<true>

Inherited from

BaseInteraction.guild


member

get member(): null | GuildMember<false, true>

Returns

null | GuildMember<false, true>

Inherited from

BaseInteraction.member


message

get message(): null | Message<false>

Returns

null | Message<false>

Inherited from

BaseInteraction.message


user

get user(): null | User<false>

Returns

null | User<false>

Inherited from

BaseInteraction.user

Methods

defer()

defer(__namedParameters): Promise<void>

Internal

Defer the interaction response. This is used automatically by commands that are set to defer. If the interaction is already deferred, this will do nothing.

Parameters

ParameterType
__namedParametersobject
__namedParameters.ephemeralundefined | boolean

Returns

Promise<void>

Inherited from

BaseInteraction.defer


followUp()

followUp(reply, options): Promise<void>

Send a followup message to the interaction

Parameters

ParameterType
replyMessagePayload
optionsInteractionReplyOptions

Returns

Promise<void>

Inherited from

BaseInteraction.followUp


reply()

reply(data, options): Promise<void>

Reply to an interaction. If the interaction is deferred, this will edit the original response.

Parameters

ParameterTypeDescription
dataMessagePayloadThe response data
optionsInteractionReplyOptions-

Returns

Promise<void>

Inherited from

BaseInteraction.reply


showModal()

showModal(modal): Promise<void>

Show a modal to the user This can only be used if the interaction is not deferred

Parameters

ParameterType
modalModal

Returns

Promise<void>

Inherited from

BaseInteraction.showModal

On this page

Edit on GitHub