fix: remove reaction object completely

This commit is contained in:
Paul Makles
2022-07-16 15:11:34 +01:00
parent 811f94b9a8
commit 7d1452e216
2 changed files with 12 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "revolt.js",
"version": "6.0.11",
"version": "6.0.12",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"module": "esm/index.js",
+11 -3
View File
@@ -334,9 +334,17 @@ export class WebSocketClient {
case "MessageUnreact": {
const msg = this.client.messages.get(packet.id);
msg?.reactions
.get(packet.emoji_id)
?.delete(packet.user_id);
const user_ids = msg?.reactions.get(
packet.emoji_id,
);
if (user_ids) {
user_ids.delete(packet.user_id);
if (user_ids.size === 0) {
msg!.reactions.delete(packet.emoji_id);
}
}
break;
}