reactionAdd events run. Here, a reaction gives a role:
src/lib/reaction-roles.ts
src/events/roles.ts
guild, and the channel and member of the reaction, are always there.
Your function receives the reaction and the server, guild. reaction.emoji is a ReactionEmoji: name is the character of a standard emoji ('👍') or the name of a custom one, which also has an id.
The events of this page, with everything they give, are in the reference.
The message itself
A reaction comes with the id of its message, not with the message: your bot remembers no message, somessage is null. To read or change the message, ask for it with fetchMessage():
src/events/star.ts
Removed reactions
reactionRemove runs when someone takes their reaction back. Discord does not send the member with it, so reaction.member is only there when the bot remembers that person: ask for it with fetchMember().
src/events/roles.ts
reaction.user is always there: when Discord only gives the id of someone the bot does not know, it asks for them once before your file runs.
reactionClear runs when every reaction of a message is removed at once, or every reaction of one emoji: it gives reactions, whose emoji is null in the first case and that emoji in the second.
Options
The two options of the events about messages work the same here:where: 'dm'or'both'to listen in private messages too. With'both',guildisnullfor a private reaction, and oneif (guild)narrows everything.bots: true(forreactionAddandreactionRemove) to receive the reactions of bots too, yours included: a file that reacts to reactions could otherwise answer its own forever.
src/events/anywhere.ts
Polls
pollVoteAdd and pollVoteRemove run when someone votes in a poll, or takes their vote back. They give the vote and the server; vote.answerId tells which answer: Discord numbers them in the order of the poll, 1 for the first one.
src/events/log.ts
where too. A poll is sent with a message: see Sending messages.
Typing
typingStart runs when someone starts writing in a channel. It gives typing and the server; typing.startedAt says when.
src/events/log.ts
where. Discord sends it a lot: keep what the file does short.
Intents
Each of these events has its own intent, for servers and for private messages, and ChapterJS only asks for the ones your files need: a reaction file withoutwhere asks for the reactions of servers, nothing else. None of them is privileged.
Voice
Who joins, leaves or moves between voice channels.
Events reference
Every field of every event.