Interface ClientEvents

interface ClientEvents {
    applicationCommandPermissionsUpdate: [guild: Guild | Uncached, permissions: GuildApplicationCommandPermissions];
    autoModerationActionExecution: [guild: Guild | Uncached, channel: null | Uncached | AnyTextableGuildChannel, user: User | Uncached, executionOptions: AutoModerationActionExecution];
    autoModerationRuleCreate: [rule: AutoModerationRule];
    autoModerationRuleDelete: [rule: AutoModerationRule];
    autoModerationRuleUpdate: [rule: AutoModerationRule, oldRule: null | JSONAutoModerationRule];
    channelCreate: [channel: AnyGuildChannelWithoutThreads | GroupChannel];
    channelDelete: [channel: PrivateChannel | AnyGuildChannelWithoutThreads | DeletedPrivateChannel];
    channelPinsUpdate: [channel: Uncached | AnyTextableChannel, timestamp: null | Date];
    channelUpdate: [channel: TextChannel, oldChannel: null | JSONTextChannel] | [channel: VoiceChannel, oldChannel: null | JSONVoiceChannel] | [channel: CategoryChannel, oldChannel: null | JSONCategoryChannel] | [channel: AnnouncementChannel, oldChannel: null | JSONAnnouncementChannel] | [channel: StageChannel, oldChannel: null | JSONStageChannel] | [channel: ForumChannel, oldChannel: null | JSONThreadOnlyChannel];
    connect: [id: number];
    debug: [info: string, shard?: number];
    disconnect: [];
    entitlementCreate: [entitlement: Entitlement | TestEntitlement];
    entitlementDelete: [entitlement: Entitlement | TestEntitlement];
    entitlementUpdate: [entitlement: Entitlement | TestEntitlement, oldEntitlement: null | JSONEntitlement | JSONTestEntitlement];
    error: [info: string | Error, shard?: number];
    guildAuditLogEntryCreate: [guild: Guild | Uncached, auditLogEntry: AuditLogEntry];
    guildAvailable: [guild: Guild];
    guildBanAdd: [guild: Guild | Uncached, user: User];
    guildBanRemove: [guild: Guild | Uncached, user: User];
    guildCreate: [guild: Guild];
    guildDelete: [guild: Guild | Uncached];
    guildEmojisUpdate: [guild: Guild | Uncached, emojis: GuildEmoji[], oldEmojis: null | GuildEmoji[]];
    guildIntegrationsUpdate: [guild: Guild | Uncached];
    guildMemberAdd: [member: Member];
    guildMemberChunk: [members: Member[]];
    guildMemberRemove: [member: User | Member, guild: Guild | Uncached];
    guildMemberUpdate: [member: Member, oldMember: null | JSONMember];
    guildRoleCreate: [role: Role];
    guildRoleDelete: [role: Role | Uncached, guild: Guild | Uncached];
    guildRoleUpdate: [role: Role, oldRole: null | JSONRole];
    guildScheduledEventCreate: [event: GuildScheduledEvent];
    guildScheduledEventDelete: [event: GuildScheduledEvent];
    guildScheduledEventUpdate: [event: GuildScheduledEvent, oldEvent: null | JSONScheduledEvent];
    guildScheduledEventUserAdd: [event: Uncached | GuildScheduledEvent, user: User | Uncached];
    guildScheduledEventUserRemove: [event: Uncached | GuildScheduledEvent, user: User | Uncached];
    guildStickersUpdate: [guild: Guild | Uncached, stickers: Sticker[], oldStickers: null | Sticker[]];
    guildUnavailable: [guild: UnavailableGuild];
    guildUpdate: [guild: Guild, oldGuild: null | JSONGuild];
    hello: [interval: number, shard: number];
    integrationCreate: [guild: Guild | Uncached, integration: Integration];
    integrationDelete: [guild: Guild | Uncached, integration: PossiblyUncachedIntegration];
    integrationUpdate: [guild: Guild | Uncached, integration: Integration, oldIntegration: null | JSONIntegration];
    interactionCreate: [interaction: AnyInteractionGateway];
    inviteCreate: [invite: Invite<"withMetadata", AnyInviteChannel | Uncached>];
    inviteDelete: [invite: PossiblyUncachedInvite];
    messageCreate: [message: Message<Uncached | AnyTextableChannel>];
    messageDelete: [message: PossiblyUncachedMessage];
    messageDeleteBulk: [messages: PossiblyUncachedMessage[]];
    messagePollVoteAdd: [message: PossiblyUncachedMessage, user: User | Uncached, answer: PollAnswer | {
        answerID: number;
    }];
    messagePollVoteRemove: [message: PossiblyUncachedMessage, user: User | Uncached, answer: PollAnswer | {
        answerID: number;
    }];
    messageReactionAdd: [message: PossiblyUncachedMessage & {
        author?: User | Member | Uncached;
    }, reactor: User | Member | Uncached, reaction: PartialEmoji, burst: boolean];
    messageReactionRemove: [message: PossiblyUncachedMessage, reactor: User | Member | Uncached, reaction: PartialEmoji, burst: boolean];
    messageReactionRemoveAll: [message: PossiblyUncachedMessage];
    messageReactionRemoveEmoji: [message: PossiblyUncachedMessage, reaction: PartialEmoji];
    messageUpdate: [message: Message<Uncached | AnyTextableChannel>, oldMessage: null | JSONMessage];
    packet: [data: AnyDispatchPacket, shard: number];
    presenceUpdate: [guild: Guild | Uncached, member: Member | Uncached, presence: Presence, oldPresence: null | Presence];
    ready: [];
    request: [rawRequest: RawRequest];
    shardDisconnect: [err: Error, id: number];
    shardPreReady: [id: number];
    shardReady: [id: number];
    shardResume: [id: number];
    stageInstanceCreate: [instance: StageInstance];
    stageInstanceDelete: [instance: StageInstance];
    stageInstanceUpdate: [instance: StageInstance, oldInstance: null | JSONStageInstance];
    threadCreate: [thread: AnyThreadChannel];
    threadDelete: [thread: PossiblyUncachedThread];
    threadListSync: [threads: AnyThreadChannel[], members: ThreadMember[]];
    threadMemberUpdate: [thread: MinimalPossiblyUncachedThread, member: ThreadMember, oldMember: null | ThreadMember];
    threadMembersUpdate: [thread: MinimalPossiblyUncachedThread, addedMembers: ThreadMember[], removedMembers: (ThreadMember | UncachedThreadMember)[]];
    threadUpdate: [thread: AnnouncementThreadChannel, oldThread: null | JSONAnnouncementThreadChannel] | [thread: PublicThreadChannel, oldThread: null | JSONPublicThreadChannel] | [thread: PrivateThreadChannel, oldThread: null | JSONPrivateThreadChannel];
    typingStart: [channel: PrivateChannel | Uncached, user: User | Uncached, startTimestamp: Date] | [channel: Uncached | AnyTextableGuildChannel, member: Member, startTimestamp: Date];
    unavailableGuildCreate: [guild: UnavailableGuild];
    userUpdate: [user: User, oldUser: null | JSONUser];
    voiceChannelEffectSend: [channel: AnyVoiceChannel | Uncached & {
        guild: Guild | Uncached;
    }, user: User | Member | Uncached, effect: VoiceChannelEffect];
    voiceChannelJoin: [member: Member, channel: VoiceChannel | StageChannel | Uncached];
    voiceChannelLeave: [member: Member, channel: null | VoiceChannel | StageChannel | Uncached];
    voiceChannelStatusUpdate: [channel: VoiceChannel | Uncached, status: null | string];
    voiceChannelSwitch: [member: Member, channel: VoiceChannel | StageChannel | Uncached, oldChannel: null | VoiceChannel | StageChannel | Uncached];
    voiceStateUpdate: [member: Member, oldState: null | JSONVoiceState];
    warn: [info: string, shard?: number];
    webhooksUpdate: [guild: Guild | Uncached, channel: AnyGuildChannelWithoutThreads | Uncached];
}

Events

applicationCommandPermissionsUpdate: [guild: Guild | Uncached, permissions: GuildApplicationCommandPermissions]

Emitted when an application command's permissions are updated.

autoModerationActionExecution: [guild: Guild | Uncached, channel: null | Uncached | AnyTextableGuildChannel, user: User | Uncached, executionOptions: AutoModerationActionExecution]

Emitted when an auto moderation action is executed. Requires the AUTO_MODERATION_EXECUTION intent.

autoModerationRuleCreate: [rule: AutoModerationRule]

Emitted when an auto moderation rule is created. Requires the AUTO_MODERATION_CONFIGURATION intent.

autoModerationRuleDelete: [rule: AutoModerationRule]

Emitted when an auto moderation rule is deleted. Requires the AUTO_MODERATION_CONFIGURATION intent.

autoModerationRuleUpdate: [rule: AutoModerationRule, oldRule: null | JSONAutoModerationRule]

Emitted when an auto moderation rule is updated. Requires the AUTO_MODERATION_CONFIGURATION intent.

channelCreate: [channel: AnyGuildChannelWithoutThreads | GroupChannel]

Emitted when a channel is created. Guild channels require the GUILDS intent.

Emitted when channel is deleted. Requires the GUILDS intent.

channelPinsUpdate: [channel: Uncached | AnyTextableChannel, timestamp: null | Date]

Emitted when a channel's pins are updated (message pinned, message unpinned). Requires the GUILDS intent for guild channels, and DIRECT_MESSAGES for direct messages.

channelUpdate: [channel: TextChannel, oldChannel: null | JSONTextChannel] | [channel: VoiceChannel, oldChannel: null | JSONVoiceChannel] | [channel: CategoryChannel, oldChannel: null | JSONCategoryChannel] | [channel: AnnouncementChannel, oldChannel: null | JSONAnnouncementChannel] | [channel: StageChannel, oldChannel: null | JSONStageChannel] | [channel: ForumChannel, oldChannel: null | JSONThreadOnlyChannel]

Emitted when a channel is updated. Requires the GUILDS intent.

connect: [id: number]

Emitted when a shard connects.

debug: [info: string, shard?: number]

Emitted with various information for debugging.

disconnect: []

Emitted when all shards disconnect.

entitlementCreate: [entitlement: Entitlement | TestEntitlement]

Emitted when an entitlement is created.

entitlementDelete: [entitlement: Entitlement | TestEntitlement]

Emitted when an entitlement is deleted. Note that expired entitlements are not deleted.

entitlementUpdate: [entitlement: Entitlement | TestEntitlement, oldEntitlement: null | JSONEntitlement | JSONTestEntitlement]

Emitted when an entitlement is updated.

error: [info: string | Error, shard?: number]

Emitted when an error happens. If an error is emitted and no handlers are present, the error will be thrown.

guildAuditLogEntryCreate: [guild: Guild | Uncached, auditLogEntry: AuditLogEntry]

Emitted when an audit log entry is created. Requires both the GUILD_MODERATION intent, as well as the VIEW_AUDIT_LOG permission.

guildAvailable: [guild: Guild]

Emitted when a guild becomes available. Requires the GUILDS intent.

guildBanAdd: [guild: Guild | Uncached, user: User]

Emitted when a guild ban is created. Requires the GUILD_BANS intent.

guildBanRemove: [guild: Guild | Uncached, user: User]

Emitted when a guild ban is revoked. Requires the GUILD_BANS intent.

guildCreate: [guild: Guild]

Emitted when the client joins a new guild. Requires the GUILDS intent.

guildDelete: [guild: Guild | Uncached]

Emitted when the client leaves a guild. Requires the GUILDS intent.

guildEmojisUpdate: [guild: Guild | Uncached, emojis: GuildEmoji[], oldEmojis: null | GuildEmoji[]]

Emitted when a guild's emojis are updated. Requires the GUILD_EMOJIS_AND_STICKERS intent.

guildIntegrationsUpdate: [guild: Guild | Uncached]

Emitted when a guild's integrations are updated. Requires the GUILD_INTEGRATIONS intent.

guildMemberAdd: [member: Member]

Emitted when a member joins a guild. Requires the GUILD_MEMBERS intent.

guildMemberChunk: [members: Member[]]

Emitted when a chunk of guild members is received from Discord.

guildMemberRemove: [member: User | Member, guild: Guild | Uncached]

Emitted when a member leaves a guild. Requires the GUILD_MEMBERS intent. If the member is uncached, the first parameter will be a user. If the guild is uncached, the first parameter will be a user, and the second will be an object with only an id.

guildMemberUpdate: [member: Member, oldMember: null | JSONMember]

Emitted when a guild member is updates. Requires the GUILD_MEMBERS intent.

guildRoleCreate: [role: Role]

Emitted when a role is created. Requires the GUILDS intent.

guildRoleDelete: [role: Role | Uncached, guild: Guild | Uncached]

Emitted when a role is deleted. Requires the GUILDS intent.

guildRoleUpdate: [role: Role, oldRole: null | JSONRole]

Emitted when a role is updated. Requires the GUILDS intent.

guildScheduledEventCreate: [event: GuildScheduledEvent]

Emitted when a scheduled event is created. Requires the GUILD_SCHEDULED_EVENTS intent.

guildScheduledEventDelete: [event: GuildScheduledEvent]

Emitted when a scheduled event is deleted. Requires the GUILD_SCHEDULED_EVENTS intent.

guildScheduledEventUpdate: [event: GuildScheduledEvent, oldEvent: null | JSONScheduledEvent]

Emitted when a scheduled event is updated. Requires the GUILD_SCHEDULED_EVENTS intent.

guildScheduledEventUserAdd: [event: Uncached | GuildScheduledEvent, user: User | Uncached]

Emitted when a user subscribes to a scheduled event. Requires the GUILD_SCHEDULED_EVENTS intent.

guildScheduledEventUserRemove: [event: Uncached | GuildScheduledEvent, user: User | Uncached]

Emitted when a user unsubscribes from a scheduled event. Requires the GUILD_SCHEDULED_EVENTS intent.

guildStickersUpdate: [guild: Guild | Uncached, stickers: Sticker[], oldStickers: null | Sticker[]]

Emitted when a guild's stickers are updated. Requires the GUILD_EMOJIS_AND_STICKERS intent.

guildUnavailable: [guild: UnavailableGuild]

Emitted when a guild becomes unavailable. Requires the GUILDS intent.

guildUpdate: [guild: Guild, oldGuild: null | JSONGuild]

Emitted when a guild is updated. Requires the GUILDS intent.

hello: [interval: number, shard: number]

Emitted when a shard receives the HELLO packet.

integrationCreate: [guild: Guild | Uncached, integration: Integration]

Emitted when an integration is created. Requires the GUILD_INTEGRATIONS intent.

integrationDelete: [guild: Guild | Uncached, integration: PossiblyUncachedIntegration]

Emitted when an integration is deleted. Requires the GUILD_INTEGRATIONS intent.

integrationUpdate: [guild: Guild | Uncached, integration: Integration, oldIntegration: null | JSONIntegration]

Emitted when an integration is updated. Requires the GUILD_INTEGRATIONS intent.

interactionCreate: [interaction: AnyInteractionGateway]

Emitted when an interaction is created.

inviteCreate: [invite: Invite<"withMetadata", AnyInviteChannel | Uncached>]

Emitted when an invite is created. Requires the GUILD_INVITES intent, and the MANAGE_CHANNELS permission on the channel.

inviteDelete: [invite: PossiblyUncachedInvite]

Emitted when an invite is deleted. Requires the GUILD_INVITES intent, and the MANAGE_CHANNELS permission on the channel.

messageCreate: [message: Message<Uncached | AnyTextableChannel>]

Emitted when a message is created. Requires the GUILD_MESSAGES intent for guild messages, DIRECT_MESSAGES for direct messages. The MESSAGE_CONTENT intent is required for content, embeds, and similar to be present on most messages.

messageDelete: [message: PossiblyUncachedMessage]

Emitted when a message is created. Requires the GUILD_MESSAGES intent for guild messages, DIRECT_MESSAGES for direct messages. The MESSAGE_CONTENT intent is required for content, embeds, and similar to be present on most messages.

messageDeleteBulk: [messages: PossiblyUncachedMessage[]]

Emitted when messages are bulk deleted. Requires the GUILD_MESSAGES intent. The MESSAGE_CONTENT intent is required for content, embeds, and similar to be present on most messages.

messagePollVoteAdd: [message: PossiblyUncachedMessage, user: User | Uncached, answer: PollAnswer | {
    answerID: number;
}]

Emitted when a vote is added to a poll. Requires the GUILD_MESSAGE_POLLS for guild messages, and DIRECT_MESSAGE_POLLS for direct messages.

messagePollVoteRemove: [message: PossiblyUncachedMessage, user: User | Uncached, answer: PollAnswer | {
    answerID: number;
}]

Emitted when a vote is added to a poll. Requires the GUILD_MESSAGE_POLLS for guild messages, and DIRECT_MESSAGE_POLLS for direct messages.

messageReactionAdd: [message: PossiblyUncachedMessage & {
    author?: User | Member | Uncached;
}, reactor: User | Member | Uncached, reaction: PartialEmoji, burst: boolean]

Emitted when a reaction is added to a message. For uncached messages, author will not be present if the reaction was added to a webhook message. Requires the GUILD_MESSAGE_REACTIONS for guild messages, and DIRECT_MESSAGE_REACTIONS for direct messages.

messageReactionRemove: [message: PossiblyUncachedMessage, reactor: User | Member | Uncached, reaction: PartialEmoji, burst: boolean]

Emitted when a reaction is removed from a message. Requires the GUILD_MESSAGE_REACTIONS for guild messages, and DIRECT_MESSAGE_REACTIONS for direct messages.

messageReactionRemoveAll: [message: PossiblyUncachedMessage]

Emitted when all reactions are removed from a message. Requires the GUILD_MESSAGE_REACTIONS for guild messages, and DIRECT_MESSAGE_REACTIONS for direct messages.

messageReactionRemoveEmoji: [message: PossiblyUncachedMessage, reaction: PartialEmoji]

Emitted when a specific reaction is removed for all users from a message. Requires the GUILD_MESSAGE_REACTIONS for guild messages, and DIRECT_MESSAGE_REACTIONS for direct messages.

messageUpdate: [message: Message<Uncached | AnyTextableChannel>, oldMessage: null | JSONMessage]

Emitted when a message is updated. Requires the GUILD_MESSAGES intent for guild messages, DIRECT_MESSAGES for direct messages. The MESSAGE_CONTENT intent is required for content, embeds, and similar to be present on most messages.

packet: [data: AnyDispatchPacket, shard: number]

Emitted when a raw dispatch packet is received.

presenceUpdate: [guild: Guild | Uncached, member: Member | Uncached, presence: Presence, oldPresence: null | Presence]

Emitted when a guild member's presence, or user is updated. Requires the GUILD_PRESENCES intent.

ready: []

Emitted when all shards are ready.

request: [rawRequest: RawRequest]

Emitted when a request is made.

shardDisconnect: [err: Error, id: number]

Emitted when this shard disconnects.

shardPreReady: [id: number]

Emitted when this shard has processed the READY packet from Discord.

shardReady: [id: number]

Emitted when a shard is fully ready.

shardResume: [id: number]

Emitted when a shard resumes a connection.

stageInstanceCreate: [instance: StageInstance]

Emitted when a stage instance is created.

stageInstanceDelete: [instance: StageInstance]

Emitted when a stage instance is deleted.

stageInstanceUpdate: [instance: StageInstance, oldInstance: null | JSONStageInstance]

Emitted when a stage instance is updated.

threadCreate: [thread: AnyThreadChannel]

Emitted when a thread is created. Requires the GUILDS intent.

threadDelete: [thread: PossiblyUncachedThread]

Emitted when a thread is deleted. Requires the GUILDS intent.

threadListSync: [threads: AnyThreadChannel[], members: ThreadMember[]]

Emitted when a guild's threads are synced. Requires the GUILDS intent.

threadMemberUpdate: [thread: MinimalPossiblyUncachedThread, member: ThreadMember, oldMember: null | ThreadMember]

Emitted when the client's thread member is updated. Requires the GUILDS intent.

threadMembersUpdate: [thread: MinimalPossiblyUncachedThread, addedMembers: ThreadMember[], removedMembers: (ThreadMember | UncachedThreadMember)[]]

Emitted when the members of a thread are updated. Requires the GUILDS intent. The received information will be different if GUILD_MEMBERS is also used.

threadUpdate: [thread: AnnouncementThreadChannel, oldThread: null | JSONAnnouncementThreadChannel] | [thread: PublicThreadChannel, oldThread: null | JSONPublicThreadChannel] | [thread: PrivateThreadChannel, oldThread: null | JSONPrivateThreadChannel]

Emitted when a thread is updated. Requires the GUILDS intent.

typingStart: [channel: PrivateChannel | Uncached, user: User | Uncached, startTimestamp: Date] | [channel: Uncached | AnyTextableGuildChannel, member: Member, startTimestamp: Date]

Emitted when a user starts typing. Requires the GUILD_MESSAGE_TYPING for guilds, and DIRECT_MESSAGE_TYPING for direct messages.

unavailableGuildCreate: [guild: UnavailableGuild]

Emitted when a guild is created, but is unavailable. Requires the GUILDS intent.

userUpdate: [user: User, oldUser: null | JSONUser]

Emitted when a user is updated.

voiceChannelEffectSend: [channel: AnyVoiceChannel | Uncached & {
    guild: Guild | Uncached;
}, user: User | Member | Uncached, effect: VoiceChannelEffect]

Emitted when a user uses an effect in a voice channel. Requires the GUILD_VOICE_STATES event.

voiceChannelJoin: [member: Member, channel: VoiceChannel | StageChannel | Uncached]

Emitted when a user joins a voice channel. Requires the GUILD_VOICE_STATES intent.

voiceChannelLeave: [member: Member, channel: null | VoiceChannel | StageChannel | Uncached]

Emitted when a user leaves a voice channel. Requires the GUILD_VOICE_STATES intent.

voiceChannelStatusUpdate: [channel: VoiceChannel | Uncached, status: null | string]

Emitted when a voice channel's status is updated. Requires the GUILD_VOICE_STATES intent.

voiceChannelSwitch: [member: Member, channel: VoiceChannel | StageChannel | Uncached, oldChannel: null | VoiceChannel | StageChannel | Uncached]

Emitted when a user switches voice channels. Requires the GUILD_VOICE_STATES intent.

voiceStateUpdate: [member: Member, oldState: null | JSONVoiceState]

Emitted when a user's voice state is updated. Requires the GUILD_VOICE_STATES intent.

warn: [info: string, shard?: number]

Emitted with various warning information.

webhooksUpdate: [guild: Guild | Uncached, channel: AnyGuildChannelWithoutThreads | Uncached]

Emitted when a guild's webhooks are updated. Requires the GUILD_WEBHOOKS intent.