Skip to main content
When someone is banned, the banAdd events run:
src/events/log.ts
That is all. The events of this page all happen in servers: guild is always there, and none of them has options.
Every event of this page, with what it gives, is in the reference.

Moderation

banAdd runs when someone is banned, banRemove when a ban is lifted; both give user and guild. A banned member also leaves the server, so a file of memberLeave runs too. To know who banned, kicked or changed something, listen to the audit log: auditLogEntryCreate runs for every entry Discord adds to it, and gives it as an AuditLogEntry. Discord only sends it to a bot with the ViewAuditLog permission.
src/events/kicks.ts
The values of actionType are the ones of AuditLogEvent.

The server, its emojis and its invites

  • guildUpdate runs when the server changes (name, icon, settings), with guild as it is now.
  • emojiCreate, emojiUpdate and emojiDelete run for each emoji added, changed or removed. emojiDelete gives the emoji as it was.
  • inviteCreate gives the new Invite and the channel it leads to; inviteDelete the code of an invite deleted or expired. Discord only sends them to a bot with the ManageChannels permission on that channel.
src/events/log.ts

Scheduled events

scheduledEventCreate, scheduledEventUpdate and scheduledEventDelete give the ScheduledEvent. scheduledEventUserAdd and scheduledEventUserRemove run when someone says they are interested, or no longer are.
src/events/announce.ts

Threads

A thread created, changed or deleted is a channel: channelCreate, channelUpdate and channelDelete run for it. Who is in a thread has two events of its own: threadMemberJoin (with thread and member) and threadMemberLeave (with thread and userId; member when the bot remembers them), both with guild.
src/events/hello.ts
They need the Server Members Intent: without it, Discord only says when your bot itself joins a thread.

Presences

presenceUpdate runs when someone’s status or activity changes: online, idle, playing a game. presence has the fields of a UserPresence (status, activities, clientStatus), plus whose it is: userId, and user and member when the bot knows them.
src/events/games.ts
It needs the Presence Intent, privileged, and Discord sends it a lot: once for every server your bot shares with that person, at every change. Only add such a file when your bot really needs it.

Intents

Each group of events has its intent, and ChapterJS only asks for the ones your files need:

Events reference

Every field of every event.

Guild

Everything a server has, and what your bot can do with it.