Skip to content

Commit 2de3309

Browse files
eslachancegitbook-bot
authored andcommitted
GitBook: [master] one page modified
1 parent 1ae8999 commit 2de3309

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

coding-guides/raw-events.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ client.on('raw', packet => {
5252
const emoji = packet.d.emoji.id ? `${packet.d.emoji.name}:${packet.d.emoji.id}` : packet.d.emoji.name;
5353
// This gives us the reaction we need to emit the event properly, in top of the message object
5454
const reaction = message.reactions.get(emoji);
55+
// Adds the currently reacting user to the reaction's users collection.
56+
if (reaction) reaction.users.set(packet.d.user_id, client.users.get(packet.d.user_id));
5557
// Check which type of event it is before emitting
5658
if (packet.t === 'MESSAGE_REACTION_ADD') {
5759
client.emit('messageReactionAdd', reaction, client.users.get(packet.d.user_id));

0 commit comments

Comments
 (0)