Carbon
CoreClasses

BaseInteraction

This is the base type interaction, all interaction types extend from this

Extends

  • Base

Extended by

Type Parameters

Type Parameter
T extends APIInteraction

Constructors

new BaseInteraction()

new BaseInteraction<T>(client, data, defaults): BaseInteraction<T>

Parameters

ParameterType
clientClient
dataT
defaultsInteractionDefaults

Returns

BaseInteraction<T>

Overrides

Base.constructor

Properties

PropertyTypeDefault valueDescriptionInherited from
_deferredbooleanfalseInternal Whether the interaction is deferred already-
clientClientundefined-Base.client
rawDataTundefinedThe raw data of the interaction-
typeInteractionTypeundefinedThe type of interaction-
userIdundefined | stringundefinedThe user who sent the interaction-

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


embeds

get embeds(): null | Embed[]

Returns

null | Embed[]


guild

get guild(): null | Guild<true>

Returns

null | Guild<true>


member

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

Returns

null | GuildMember<false, true>


message

get message(): null | Message<false>

Returns

null | Message<false>


user

get user(): null | User<false>

Returns

null | User<false>

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>


followUp()

followUp(reply, options): Promise<void>

Send a followup message to the interaction

Parameters

ParameterType
replyMessagePayload
optionsInteractionReplyOptions

Returns

Promise<void>


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>


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>

On this page

Edit on GitHub