Interface ClientEvents

Hierarchy

  • ClientEvents

Events

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

Emitted when an application command's permissions are updated.

autoModerationActionExecution: [guild: Uncached | Guild, channel: null | Uncached | AnyTextableGuildChannel, user: Uncached | User, 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.

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: Uncached | Guild, 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: Uncached | Guild, user: User]

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

guildBanRemove: [guild: Uncached | Guild, 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: Uncached | Guild]

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

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

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

guildIntegrationsUpdate: [guild: Uncached | Guild]

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: Member | User, guild: Uncached | Guild]

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: Uncached | Role, guild: Uncached | Guild]

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: Uncached | User]

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

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

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

guildStickersUpdate: [guild: Uncached | Guild, 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: Uncached | Guild, integration: Integration]

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

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

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

integrationUpdate: [guild: Uncached | Guild, 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", Uncached | AnyInviteChannel>]

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.

messageReactionAdd: [message: Object, reactor: Uncached | Member | User, reaction: PartialEmoji]

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: Uncached | Member | User, reaction: PartialEmoji]

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: Uncached | Guild, member: Uncached | Member, 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: Uncached | PrivateChannel, user: Uncached | User, 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: Uncached | Guild;
}, user: Uncached | Member | User, effect: VoiceChannelEffect]

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

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

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

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

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

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

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: Uncached | Guild, channel: Uncached | AnyGuildChannelWithoutThreads]

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