> ## Documentation Index
> Fetch the complete documentation index at: https://www.chapterjs.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

> Every event your bot can react to: when it happens, what it needs, and what your function receives

> [!NOTE]
>
> How to write an event file is in [Events](https://www.chapterjs.org/events.md); the events about messages and their options in [Messages](https://www.chapterjs.org/events/messages.md); `event()` and its types in [event()](https://www.chapterjs.org/reference/event.md).

An event is the `name` of an `event()` declaration. Each section below is one event: when its declarations run, the intents Discord needs for it (worked out from your files, never written by you), its options, what the bot remembers for it beyond [the default](https://www.chapterjs.org/memory.md), and what your function receives.

Intents are named as `chapterjs dev` prints them. Three are privileged, to enable in the [Developer Portal](https://www.chapterjs.org/setup/discord-application.md): `GUILD_MEMBERS` is the Server Members Intent, `GUILD_PRESENCES` the Presence Intent, `MESSAGE_CONTENT` the Message Content Intent.

## What each event gives

What your function receives, event by event: what the event is about, and the server it happened in (`guild`). Every event also receives `t`, in the language of that server, when the project has a language. The type after a colon is the one of that object, detailed in the section of the event; `where: 'dm'` and `where: 'both'` narrow `guild` as each section says.

| Event | `run` receives |
| - | - |
| [`ready`](https://www.chapterjs.org/reference/events#ready) | `user`, `guilds` |
| [`guildJoin`](https://www.chapterjs.org/reference/events#guildjoin) | `guild` |
| [`guildLeave`](https://www.chapterjs.org/reference/events#guildleave) | `guild` |
| [`guildUpdate`](https://www.chapterjs.org/reference/events#guildupdate) | `guild` |
| [`memberJoin`](https://www.chapterjs.org/reference/events#memberjoin) | `member`, `guild` |
| [`memberUpdate`](https://www.chapterjs.org/reference/events#memberupdate) | `member`, `guild` |
| [`memberLeave`](https://www.chapterjs.org/reference/events#memberleave) | `user`, `guild` |
| [`roleCreate`](https://www.chapterjs.org/reference/events#rolecreate) | `role`, `guild` |
| [`roleUpdate`](https://www.chapterjs.org/reference/events#roleupdate) | `role`, `guild` |
| [`roleDelete`](https://www.chapterjs.org/reference/events#roledelete) | `role`, `guild` |
| [`channelCreate`](https://www.chapterjs.org/reference/events#channelcreate) | `channel`, `guild` |
| [`channelUpdate`](https://www.chapterjs.org/reference/events#channelupdate) | `channel`, `guild` |
| [`channelDelete`](https://www.chapterjs.org/reference/events#channeldelete) | `channel`, `guild` |
| [`messageCreate`](https://www.chapterjs.org/reference/events#messagecreate) | `message`, `guild` |
| [`messageUpdate`](https://www.chapterjs.org/reference/events#messageupdate) | `message`, `guild` |
| [`messageDelete`](https://www.chapterjs.org/reference/events#messagedelete) | `message: DeletedMessage`, `guild` |
| [`reactionAdd`](https://www.chapterjs.org/reference/events#reactionadd) | `reaction: AddedReaction`, `guild` |
| [`reactionRemove`](https://www.chapterjs.org/reference/events#reactionremove) | `reaction: UserReaction`, `guild` |
| [`reactionClear`](https://www.chapterjs.org/reference/events#reactionclear) | `reactions: ClearedReactions`, `guild` |
| [`pollVoteAdd`](https://www.chapterjs.org/reference/events#pollvoteadd) | `vote: PollVote`, `guild` |
| [`pollVoteRemove`](https://www.chapterjs.org/reference/events#pollvoteremove) | `vote: PollVote`, `guild` |
| [`typingStart`](https://www.chapterjs.org/reference/events#typingstart) | `typing: Typing`, `guild` |
| [`threadMemberJoin`](https://www.chapterjs.org/reference/events#threadmemberjoin) | `thread`, `member`, `guild` |
| [`threadMemberLeave`](https://www.chapterjs.org/reference/events#threadmemberleave) | `thread`, `userId`, `member`, `guild` |
| [`voiceJoin`](https://www.chapterjs.org/reference/events#voicejoin) | `voice: VoiceActivity`, `guild` |
| [`voiceLeave`](https://www.chapterjs.org/reference/events#voiceleave) | `voice: VoiceActivity`, `guild` |
| [`voiceMove`](https://www.chapterjs.org/reference/events#voicemove) | `voice: VoiceMove`, `guild` |
| [`voiceUpdate`](https://www.chapterjs.org/reference/events#voiceupdate) | `voice: VoiceChange`, `guild` |
| [`presenceUpdate`](https://www.chapterjs.org/reference/events#presenceupdate) | `presence: PresenceChange`, `guild` |
| [`banAdd`](https://www.chapterjs.org/reference/events#banadd) | `user`, `guild` |
| [`banRemove`](https://www.chapterjs.org/reference/events#banremove) | `user`, `guild` |
| [`auditLogEntryCreate`](https://www.chapterjs.org/reference/events#auditlogentrycreate) | `entry`, `guild` |
| [`emojiCreate`](https://www.chapterjs.org/reference/events#emojicreate) | `emoji`, `guild` |
| [`emojiUpdate`](https://www.chapterjs.org/reference/events#emojiupdate) | `emoji`, `guild` |
| [`emojiDelete`](https://www.chapterjs.org/reference/events#emojidelete) | `emoji`, `guild` |
| [`inviteCreate`](https://www.chapterjs.org/reference/events#invitecreate) | `invite`, `guild` |
| [`inviteDelete`](https://www.chapterjs.org/reference/events#invitedelete) | `invite: DeletedInvite`, `guild` |
| [`scheduledEventCreate`](https://www.chapterjs.org/reference/events#scheduledeventcreate) | `scheduledEvent`, `guild` |
| [`scheduledEventUpdate`](https://www.chapterjs.org/reference/events#scheduledeventupdate) | `scheduledEvent`, `guild` |
| [`scheduledEventDelete`](https://www.chapterjs.org/reference/events#scheduledeventdelete) | `scheduledEvent`, `guild` |
| [`scheduledEventUserAdd`](https://www.chapterjs.org/reference/events#scheduledeventuseradd) | `interest: ScheduledEventInterest`, `guild` |
| [`scheduledEventUserRemove`](https://www.chapterjs.org/reference/events#scheduledeventuserremove) | `interest: ScheduledEventInterest`, `guild` |

## ready

| | |
| - | - |
| When | The bot is connected and knows every server it is in. Once per start, never again on reload. |
| Intents | None |
| Options | None |
| Remembers | The default |

Every event also receives `t`, in the language of the server it happened in, when the project has a language: see [`TranslationContext`](https://www.chapterjs.org/reference/messages#translationcontext).

**user** `User` *required*

The bot itself.

**guilds** `ReadonlyMap\<Snowflake, Guild\>` *required*

The servers the bot is in.

## guildJoin

| | |
| - | - |
| When | The bot was added to a server. Not when a server the bot was already in sends its data (after connecting, or after an outage). |
| Intents | `GUILDS` |
| Options | None |
| Remembers | The default |

**guild** `Guild` *required*

The server the bot was added to.

## guildLeave

| | |
| - | - |
| When | The bot was removed from a server. Not during an outage of Discord, when a server becomes unavailable but the bot is still in it. |
| Intents | `GUILDS` |
| Options | None |
| Remembers | The default |

**guild** `Guild` *required*

The server as it was, when the bot was in it.

## memberJoin

| | |
| - | - |
| When | Someone joined a server. |
| Intents | `GUILD_MEMBERS` (privileged) |
| Options | None |
| Remembers | The default |

**member** `GuildMember` *required*

The new member.

**guild** `Guild` *required*

The server they joined.

## memberUpdate

| | |
| - | - |
| When | A member changed: nickname, roles, timeout, avatar... |
| Intents | `GUILD_MEMBERS` (privileged) |
| Options | None |
| Remembers | The default |

**member** `GuildMember` *required*

The member, as they are now.

**guild** `Guild` *required*

The server of the member.

## memberLeave

| | |
| - | - |
| When | Someone left a server, or was kicked or banned. |
| Intents | `GUILD_MEMBERS` (privileged) |
| Options | None |
| Remembers | The default |

**user** `User` *required*

The account of who left.

**guild** `Guild` *required*

The server they left.

## roleCreate

| | |
| - | - |
| When | A role was created. |
| Intents | `GUILDS` |
| Options | None |
| Remembers | The default |

**role** `Role` *required*

The new role.

**guild** `Guild` *required*

The server of the role.

## roleUpdate

| | |
| - | - |
| When | A role changed: name, color, permissions, position... |
| Intents | `GUILDS` |
| Options | None |
| Remembers | The default |

**role** `Role` *required*

The role, as it is now.

**guild** `Guild` *required*

The server of the role.

## roleDelete

| | |
| - | - |
| When | A role was deleted. |
| Intents | `GUILDS` |
| Options | None |
| Remembers | The default: the bot knows every role of its servers |

**role** `Role` *required*

The role as it was.

**guild** `Guild` *required*

The server the role was in.

## channelCreate

| | |
| - | - |
| When | A channel or a thread was created. |
| Intents | `GUILDS` |
| Options | None |
| Remembers | The default |

**channel** `GuildChannel | ThreadChannel` *required*

The new channel or thread.

**guild** `Guild` *required*

The server of the channel: Discord only sends these events, with the Guilds intent, for the channels of a server.

## channelUpdate

| | |
| - | - |
| When | A channel or a thread changed: name, topic, permissions... |
| Intents | `GUILDS` |
| Options | None |
| Remembers | The default |

**channel** `GuildChannel | ThreadChannel` *required*

The channel or thread, as it is now.

**guild** `Guild` *required*

The server of the channel: Discord only sends these events, with the Guilds intent, for the channels of a server.

## channelDelete

| | |
| - | - |
| When | A channel or a thread was deleted. |
| Intents | `GUILDS` |
| Options | None |
| Remembers | The default |

**channel** `GuildChannel | ThreadChannel` *required*

The channel or thread as it was.

**guild** `Guild` *required*

The server of the channel: Discord only sends these events, with the Guilds intent, for the channels of a server.

## messageCreate

| | |
| - | - |
| When | A message was sent, in a server or in private. By default, only by a person, in a server. |
| Intents | `MESSAGE_CONTENT` (privileged), plus `GUILD_MESSAGES` for a file that listens in servers and `DIRECT_MESSAGES` for a file that listens in private messages |
| Options | `bots`, `where` ([MessageEventOptions](https://www.chapterjs.org/reference/event.md#messageeventoptions)) |
| Remembers | The default |

**message** `MemberMessage` *required*

The message that was sent. The type follows the options of the file: `MemberMessage` by default, `GuildMessage` with `bots: true`, `DmMessage` with `where: 'dm'`, `MemberMessage | PrivateMessage` with `where: 'both'` (`GuildMessage | PrivateMessage` with both options). The four are in [Message](https://www.chapterjs.org/reference/message.md#types).

**guild** `Guild` *required*

The server. With `where: 'dm'` it does not exist; with `where: 'both'` it is `null` for a private message.

## messageUpdate

| | |
| - | - |
| When | A message was edited. By default, only a message of a person, in a server. |
| Intents | `MESSAGE_CONTENT` (privileged), plus `GUILD_MESSAGES` for a file that listens in servers and `DIRECT_MESSAGES` for a file that listens in private messages |
| Options | `bots`, `where` ([MessageEventOptions](https://www.chapterjs.org/reference/event.md#messageeventoptions)) |
| Remembers | The default |

**message** `MemberMessage` *required*

The message, as it is now. The type follows the options of the file, like for `messageCreate`.

**guild** `Guild` *required*

The server. With `where: 'dm'` it does not exist; with `where: 'both'` it is `null` for a private message.

## messageDelete

| | |
| - | - |
| When | A message was deleted. By default, only in a server. Messages deleted together (by a moderator, or by `bulkDelete()`) are one `messageDelete` each. |
| Intents | `GUILD_MESSAGES` for a file that listens in servers, `DIRECT_MESSAGES` for a file that listens in private messages |
| Options | `where` ([WhereEventOptions](https://www.chapterjs.org/reference/event.md#whereeventoptions)) |
| Remembers | The default: no message, so `message.before` is `null` today |

What a file without `where` receives:

**message** `DeletedMessage` *required*

The message that was deleted.

**properties**

**id** `Snowflake` *required*

The id of the deleted message.

**channelId** `Snowflake` *required*

The id of the channel the message was in.

**channel** `GuildTextBasedChannel` *required*

The channel the message was in.

**guildId** `Snowflake` *required*

The id of the server.

**before** `GuildMessage | null` *required*

The message as it was, when the bot remembered it.

**guild** `Guild` *required*

The server the message was in.

With `where: 'dm'`, `guild` does not exist, and in `message` `channel` is a `DMChannel | null` (the private conversation, when the bot knows it), `before` a `DmMessage | null` and `guildId` does not exist. With `where: 'both'`, something private comes with `guild: null`, so `guild` tells the two apart.

## reactionAdd

| | |
| - | - |
| When | Someone added a reaction to a message. By default, only a person, in a server. |
| Intents | `GUILD_MESSAGE_REACTIONS` for a file that listens in servers, `DIRECT_MESSAGE_REACTIONS` for a file that listens in private messages |
| Options | `bots`, `where` ([ReactionEventOptions](https://www.chapterjs.org/reference/event.md#reactioneventoptions)) |
| Remembers | The default: no message, so `reaction.message` is `null` today |

What a file without `where` receives:

**reaction** `AddedReaction` *required*

The reaction that was added.

**properties**

**emoji** `ReactionEmoji` *required*

The emoji of the reaction: [`ReactionEmoji`](https://www.chapterjs.org/reference/data#reactionemoji).

**user** `User` *required*

Who reacted.

**member** `GuildMember` *required*

Who reacted, as a member of the server.

**burst** `boolean` *required*

Whether it is a super reaction.

**messageId** `Snowflake` *required*

The id of the message.

**message** `GuildMessage | null` *required*

The message, when the bot remembers it.

**messageAuthorId** `Snowflake | null` *required*

The id of who wrote the message, when Discord says it.

**channelId** `Snowflake` *required*

The id of the channel of the message.

**channel** `GuildTextBasedChannel` *required*

The channel of the message.

**guildId** `Snowflake` *required*

The id of the server.

**guild** `Guild` *required*

The server.

With `where: 'dm'`, `guild` does not exist, and in `reaction` `channel` is a `DMChannel | null` (the private conversation, when the bot knows it), `message` a `DmMessage | null`, and `guildId` and `member` do not exist; with `'both'`, a private reaction has `guildId: null` and `member: null`. With `where: 'both'`, something private comes with `guild: null`, so `guild` tells the two apart.

## reactionRemove

| | |
| - | - |
| When | Someone removed their reaction from a message. By default, only a person, in a server. |
| Intents | `GUILD_MESSAGE_REACTIONS` for a file that listens in servers, `DIRECT_MESSAGE_REACTIONS` for a file that listens in private messages |
| Options | `bots`, `where` ([ReactionEventOptions](https://www.chapterjs.org/reference/event.md#reactioneventoptions)) |
| Remembers | The default |

What a file without `where` receives:

**reaction** `UserReaction` *required*

The reaction that was removed.

**properties**

**emoji** `ReactionEmoji` *required*

The emoji of the reaction: [`ReactionEmoji`](https://www.chapterjs.org/reference/data#reactionemoji).

**user** `User` *required*

Who reacted.

**member** `GuildMember | null` *required*

Who reacted, as a member of the server, when the bot remembers it.

**burst** `boolean` *required*

Whether it is a super reaction.

**messageId** `Snowflake` *required*

The id of the message.

**message** `GuildMessage | null` *required*

The message, when the bot remembers it.

**channelId** `Snowflake` *required*

The id of the channel of the message.

**channel** `GuildTextBasedChannel` *required*

The channel of the message.

**guildId** `Snowflake` *required*

The id of the server.

**guild** `Guild` *required*

The server.

With `where: 'dm'`, `guild` does not exist, and in `reaction` `channel` is a `DMChannel | null` (the private conversation, when the bot knows it), `message` a `DmMessage | null`, and `guildId` and `member` do not exist; with `'both'`, a private reaction has `guildId: null` and `member: null`. With `where: 'both'`, something private comes with `guild: null`, so `guild` tells the two apart.

## reactionClear

| | |
| - | - |
| When | The reactions of a message were removed: all of them, or every reaction of one emoji. By default, only in a server. |
| Intents | `GUILD_MESSAGE_REACTIONS` for a file that listens in servers, `DIRECT_MESSAGE_REACTIONS` for a file that listens in private messages |
| Options | `where` ([WhereEventOptions](https://www.chapterjs.org/reference/event.md#whereeventoptions)) |
| Remembers | The default |

What a file without `where` receives:

**reactions** `ClearedReactions` *required*

The reactions that were removed.

**properties**

**emoji** `ReactionEmoji | null` *required*

The emoji whose reactions were removed; `null` when all were.

**messageId** `Snowflake` *required*

The id of the message.

**message** `GuildMessage | null` *required*

The message, when the bot remembers it.

**channelId** `Snowflake` *required*

The id of the channel of the message.

**channel** `GuildTextBasedChannel` *required*

The channel of the message.

**guildId** `Snowflake` *required*

The id of the server.

**guild** `Guild` *required*

The server.

With `where: 'dm'`, `guild` does not exist, and in `reactions` `channel` is a `DMChannel | null` (the private conversation, when the bot knows it), `message` a `DmMessage | null` and `guildId` does not exist. With `where: 'both'`, something private comes with `guild: null`, so `guild` tells the two apart.

## pollVoteAdd

| | |
| - | - |
| When | Someone voted in a poll. By default, only in a server. |
| Intents | `GUILD_MESSAGE_POLLS` for a file that listens in servers, `DIRECT_MESSAGE_POLLS` for a file that listens in private messages |
| Options | `where` ([WhereEventOptions](https://www.chapterjs.org/reference/event.md#whereeventoptions)) |
| Remembers | The default |

What a file without `where` receives:

**vote** `PollVote` *required*

The vote.

**properties**

**answerId** `number` *required*

The id Discord gave to the answer: today, its position in the poll, `1` for the first answer.

**user** `User` *required*

Who voted.

**member** `GuildMember | null` *required*

Who voted, as a member of the server, when the bot remembers it.

**messageId** `Snowflake` *required*

The id of the message of the poll.

**message** `GuildMessage | null` *required*

The message of the poll, when the bot remembers it.

**channelId** `Snowflake` *required*

The id of the channel of the poll.

**channel** `GuildTextBasedChannel` *required*

The channel of the poll.

**guildId** `Snowflake` *required*

The id of the server.

**guild** `Guild` *required*

The server.

With `where: 'dm'`, `guild` does not exist, and in `vote` `channel` is a `DMChannel | null` (the private conversation, when the bot knows it), `message` a `DmMessage | null`, and `guildId` and `member` do not exist; with `'both'`, a private vote has `guildId: null` and `member: null`. With `where: 'both'`, something private comes with `guild: null`, so `guild` tells the two apart.

## pollVoteRemove

| | |
| - | - |
| When | Someone took back their vote in a poll. By default, only in a server. |
| Intents | `GUILD_MESSAGE_POLLS` for a file that listens in servers, `DIRECT_MESSAGE_POLLS` for a file that listens in private messages |
| Options | `where` ([WhereEventOptions](https://www.chapterjs.org/reference/event.md#whereeventoptions)) |
| Remembers | The default |

Receives the same as `pollVoteAdd`: `vote` is the vote taken back.

## typingStart

| | |
| - | - |
| When | Someone started typing in a channel. By default, only in a server. |
| Intents | `GUILD_MESSAGE_TYPING` for a file that listens in servers, `DIRECT_MESSAGE_TYPING` for a file that listens in private messages |
| Options | `where` ([WhereEventOptions](https://www.chapterjs.org/reference/event.md#whereeventoptions)) |
| Remembers | The default |

What a file without `where` receives:

**typing** `Typing` *required*

Who is typing, and where.

**properties**

**user** `User` *required*

Who is typing.

**member** `GuildMember` *required*

Who is typing, as a member of the server.

**startedAt** `Date` *required*

When they started.

**channelId** `Snowflake` *required*

The id of the channel.

**channel** `GuildTextBasedChannel` *required*

The channel.

**guildId** `Snowflake` *required*

The id of the server.

**guild** `Guild` *required*

The server.

With `where: 'dm'`, `guild` does not exist, and in `typing` `channel` is a `DMChannel | null` (the private conversation, when the bot knows it), and `guildId` and `member` do not exist; with `'both'`, someone typing in private has `guildId: null` and `member: null`. With `where: 'both'`, something private comes with `guild: null`, so `guild` tells the two apart.

## threadMemberJoin

| | |
| - | - |
| When | Someone was added to a thread, or joined it. |
| Intents | `GUILD_MEMBERS` (privileged): without it, Discord only says when the bot itself joins a thread |
| Options | None |
| Remembers | The default |

**thread** `ThreadChannel` *required*

The thread.

**member** `GuildMember` *required*

Who was added, as a member of the server.

**guild** `Guild` *required*

The server of the thread.

## threadMemberLeave

| | |
| - | - |
| When | Someone was removed from a thread, or left it. |
| Intents | `GUILD_MEMBERS` (privileged) |
| Options | None |
| Remembers | The default |

**thread** `ThreadChannel` *required*

The thread.

**userId** `Snowflake` *required*

The id of who was removed.

**member** `GuildMember | null` *required*

Who was removed, as a member of the server, when the bot remembers it.

**guild** `Guild` *required*

The server of the thread.

## voiceJoin

| | |
| - | - |
| When | Someone joined a voice channel. |
| Intents | `GUILD_VOICE_STATES` |
| Options | None |
| Remembers | Who is in a voice channel, while they are in it |

**voice** `VoiceActivity` *required*

Who joined, the channel, and their voice state.

**properties**

**member** `GuildMember` *required*

Who it is.

**channel** `VoiceChannel` *required*

The voice channel.

**state** `VoiceState` *required*

Their voice state: muted, deafened, streaming... ([`VoiceState`](https://www.chapterjs.org/reference/data#voicestate))

**guild** `Guild` *required*

The server of the channel.

## voiceLeave

| | |
| - | - |
| When | Someone left a voice channel, or was disconnected. |
| Intents | `GUILD_VOICE_STATES` |
| Options | None |
| Remembers | Who is in a voice channel, while they are in it |

**voice** `VoiceActivity` *required*

Who left, the channel they left, and their voice state as it was.

**properties**

**member** `GuildMember` *required*

Who it is.

**channel** `VoiceChannel` *required*

The voice channel.

**state** `VoiceState` *required*

Their voice state, as it was in that channel.

**guild** `Guild` *required*

The server of the channel.

## voiceMove

| | |
| - | - |
| When | Someone went from one voice channel to another, or was moved. |
| Intents | `GUILD_VOICE_STATES` |
| Options | None |
| Remembers | Who is in a voice channel, while they are in it |

**voice** `VoiceMove` *required*

Who moved, from where, to where.

**properties**

**member** `GuildMember` *required*

Who moved.

**from** `VoiceChannel` *required*

The channel they left.

**to** `VoiceChannel` *required*

The channel they are in now.

**state** `VoiceState` *required*

Their voice state, as it is now.

**guild** `Guild` *required*

The server of the channels.

## voiceUpdate

| | |
| - | - |
| When | Someone in a voice channel changed: muted, deafened, started a stream or a camera... Not when they join, leave or move. |
| Intents | `GUILD_VOICE_STATES` |
| Options | None |
| Remembers | Who is in a voice channel, while they are in it |

**voice** `VoiceChange` *required*

Who changed, their voice state now and before.

**properties**

**member** `GuildMember` *required*

Who it is.

**channel** `VoiceChannel` *required*

The voice channel.

**state** `VoiceState` *required*

Their voice state, as it is now.

**before** `VoiceState` *required*

Their voice state as it was.

**guild** `Guild` *required*

The server of the channel.

## presenceUpdate

| | |
| - | - |
| When | Someone's status or activity changed: online, idle, playing a game... Sent for each server the bot shares with them. |
| Intents | `GUILD_PRESENCES` (privileged) |
| Options | None |
| Remembers | The default |

**presence** `PresenceChange` *required*

The presence as it is now, and whose it is: the fields of [`UserPresence`](https://www.chapterjs.org/reference/data#userpresence) (`status`, `activities`, `clientStatus`), plus:

**properties**

**userId** `Snowflake` *required*

The id of whose presence changed.

**user** `User | null` *required*

The account of whose presence changed, when the bot knows it.

**member** `GuildMember | null` *required*

Whose presence changed, as a member of the server, when the bot remembers it.

**guild** `Guild` *required*

The server the change is seen from.

## guildUpdate

| | |
| - | - |
| When | The server changed: name, icon, settings... |
| Intents | `GUILDS` |
| Options | None |
| Remembers | The default |

**guild** `Guild` *required*

The server, as it is now.

## banAdd

| | |
| - | - |
| When | Someone was banned from a server. They also leave it: `memberLeave` runs too. |
| Intents | `GUILD_MODERATION` |
| Options | None |
| Remembers | The default |

**user** `User` *required*

The account that was banned.

**guild** `Guild` *required*

The server they were banned from.

## banRemove

| | |
| - | - |
| When | A ban was lifted: the person can join the server again. |
| Intents | `GUILD_MODERATION` |
| Options | None |
| Remembers | The default |

**user** `User` *required*

The account that is no longer banned.

**guild** `Guild` *required*

The server of the ban.

## auditLogEntryCreate

| | |
| - | - |
| When | Something was added to the audit log of a server. Only for a bot with the `ViewAuditLog` permission there. |
| Intents | `GUILD_MODERATION` |
| Options | None |
| Remembers | The default |

**entry** `AuditLogEntry` *required*

What was done, by whom, on what. See [`AuditLogEntry`](https://www.chapterjs.org/reference/data#auditlogentry).

**guild** `Guild` *required*

The server of the audit log.

## emojiCreate

| | |
| - | - |
| When | An emoji was added to a server. |
| Intents | `GUILD_EXPRESSIONS` |
| Options | None |
| Remembers | The default: the bot knows every emoji of its servers |

**emoji** `GuildEmoji` *required*

The new emoji.

**guild** `Guild` *required*

The server of the emoji.

## emojiUpdate

| | |
| - | - |
| When | An emoji of a server changed: its name, or who can use it. |
| Intents | `GUILD_EXPRESSIONS` |
| Options | None |
| Remembers | The default |

**emoji** `GuildEmoji` *required*

The emoji, as it is now.

**guild** `Guild` *required*

The server of the emoji.

## emojiDelete

| | |
| - | - |
| When | An emoji was removed from a server. |
| Intents | `GUILD_EXPRESSIONS` |
| Options | None |
| Remembers | The default |

**emoji** `GuildEmoji` *required*

The emoji as it was.

**guild** `Guild` *required*

The server the emoji was in.

## inviteCreate

| | |
| - | - |
| When | An invite to a server was created. Only for a bot with the `ManageChannels` permission on its channel. |
| Intents | `GUILD_INVITES` |
| Options | None |
| Remembers | The default |

**invite** `Invite` *required*

The new invite. `invite.channel` is the channel it leads to.

**guild** `Guild` *required*

The server the invite leads to.

## inviteDelete

| | |
| - | - |
| When | An invite was deleted, or expired. Only for a bot with the `ManageChannels` permission on its channel. |
| Intents | `GUILD_INVITES` |
| Options | None |
| Remembers | The default |

**invite** `DeletedInvite` *required*

The invite that was deleted.

**properties**

**code** `string` *required*

The code of the invite (`discord.gg/code`).

**channel** `GuildChannel` *required*

The channel the invite led to.

**guild** `Guild` *required*

The server the invite led to.

## scheduledEventCreate

| | |
| - | - |
| When | An event was scheduled in a server. |
| Intents | `GUILD_SCHEDULED_EVENTS` |
| Options | None |
| Remembers | The default |

**scheduledEvent** `ScheduledEvent` *required*

The new scheduled event: see [`ScheduledEvent`](https://www.chapterjs.org/reference/data#scheduledevent).

**guild** `Guild` *required*

The server of the scheduled event.

## scheduledEventUpdate

| | |
| - | - |
| When | A scheduled event changed: its time, its place, or it started or ended. |
| Intents | `GUILD_SCHEDULED_EVENTS` |
| Options | None |
| Remembers | The default |

**scheduledEvent** `ScheduledEvent` *required*

The scheduled event, as it is now.

**guild** `Guild` *required*

The server of the scheduled event.

## scheduledEventDelete

| | |
| - | - |
| When | A scheduled event was deleted. |
| Intents | `GUILD_SCHEDULED_EVENTS` |
| Options | None |
| Remembers | The default |

**scheduledEvent** `ScheduledEvent` *required*

The scheduled event as it was.

**guild** `Guild` *required*

The server the scheduled event was in.

## scheduledEventUserAdd

| | |
| - | - |
| When | Someone said they are interested in a scheduled event. |
| Intents | `GUILD_SCHEDULED_EVENTS` |
| Options | None |
| Remembers | The default |

**interest** `ScheduledEventInterest` *required*

Who is interested, in which scheduled event.

**properties**

**scheduledEventId** `Snowflake` *required*

The id of the scheduled event.

**user** `User` *required*

Who it is.

**member** `GuildMember | null` *required*

Who it is, as a member of the server, when the bot remembers it.

**guild** `Guild` *required*

The server of the scheduled event.

## scheduledEventUserRemove

| | |
| - | - |
| When | Someone is no longer interested in a scheduled event. |
| Intents | `GUILD_SCHEDULED_EVENTS` |
| Options | None |
| Remembers | The default |

**interest** `ScheduledEventInterest` *required*

Who is no longer interested, in which scheduled event.

**properties**

**scheduledEventId** `Snowflake` *required*

The id of the scheduled event.

**user** `User` *required*

Who it is.

**member** `GuildMember | null` *required*

Who it is, as a member of the server, when the bot remembers it.

**guild** `Guild` *required*

The server of the scheduled event.

## When Discord only gives an id

Some events come with the id of who did it and nothing more: removing a reaction, voting, typing in private, being interested in a scheduled event. When the bot does not know that person yet, it asks Discord once before running your files, then remembers them: `user` is always there. Like for [a channel the bot does not know](https://www.chapterjs.org/events/messages.md#a-channel-the-bot-does-not-know), when Discord refuses, the event is not delivered and you are told:

```text theme={"theme":{"light":"github-light","dark":"vesper"}}
⚠ A reactionRemove event was not given to your files: Discord did not let the bot read the user who did it (Discord refused GET /users/{user.id}: Unknown User (10013)).
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.