revolt.js
Advanced tools
Comparing version 6.0.11 to 6.0.12
@@ -96,3 +96,3 @@ "use strict"; | ||
const process = (packet) => __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
this.client.emit("packet", packet); | ||
@@ -259,3 +259,9 @@ try { | ||
const msg = this.client.messages.get(packet.id); | ||
(_b = msg === null || msg === void 0 ? void 0 : msg.reactions.get(packet.emoji_id)) === null || _b === void 0 ? void 0 : _b.delete(packet.user_id); | ||
const user_ids = msg === null || msg === void 0 ? void 0 : 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; | ||
@@ -306,4 +312,4 @@ } | ||
case "ChannelGroupJoin": { | ||
(_c = this.client.channels | ||
.get(packet.id)) === null || _c === void 0 ? void 0 : _c.updateGroupJoin(packet.user); | ||
(_b = this.client.channels | ||
.get(packet.id)) === null || _b === void 0 ? void 0 : _b.updateGroupJoin(packet.user); | ||
break; | ||
@@ -314,3 +320,3 @@ } | ||
if (channel) { | ||
if (packet.user === ((_d = this.client.user) === null || _d === void 0 ? void 0 : _d._id)) { | ||
if (packet.user === ((_c = this.client.user) === null || _c === void 0 ? void 0 : _c._id)) { | ||
channel.delete(true); | ||
@@ -400,3 +406,3 @@ } | ||
if (server) { | ||
const role = Object.assign(Object.assign({}, (_e = server.roles) === null || _e === void 0 ? void 0 : _e[packet.role_id]), packet.data); | ||
const role = Object.assign(Object.assign({}, (_d = server.roles) === null || _d === void 0 ? void 0 : _d[packet.role_id]), packet.data); | ||
server.roles = Object.assign(Object.assign({}, server.roles), { [packet.role_id]: role }); | ||
@@ -410,3 +416,3 @@ this.client.emit("role/update", packet.role_id, role, packet.id); | ||
if (server) { | ||
const _k = (_f = server.roles) !== null && _f !== void 0 ? _f : {}, _l = packet.role_id, _ = _k[_l], roles = __rest(_k, [typeof _l === "symbol" ? _l : _l + ""]); | ||
const _j = (_e = server.roles) !== null && _e !== void 0 ? _e : {}, _k = packet.role_id, _ = _j[_k], roles = __rest(_j, [typeof _k === "symbol" ? _k : _k + ""]); | ||
server.roles = roles; | ||
@@ -418,4 +424,4 @@ this.client.emit("role/delete", packet.role_id, packet.id); | ||
case "UserUpdate": { | ||
(_g = this.client.users | ||
.get(packet.id)) === null || _g === void 0 ? void 0 : _g.update(packet.data, packet.clear); | ||
(_f = this.client.users | ||
.get(packet.id)) === null || _f === void 0 ? void 0 : _f.update(packet.data, packet.clear); | ||
break; | ||
@@ -446,4 +452,4 @@ } | ||
case "ChannelStopTyping": { | ||
(_h = this.client.channels | ||
.get(packet.id)) === null || _h === void 0 ? void 0 : _h.updateStopTyping(packet.user); | ||
(_g = this.client.channels | ||
.get(packet.id)) === null || _g === void 0 ? void 0 : _g.updateStopTyping(packet.user); | ||
clearInterval(timeouts[packet.id + packet.user]); | ||
@@ -453,3 +459,3 @@ break; | ||
case "ChannelAck": { | ||
(_j = this.client.unreads) === null || _j === void 0 ? void 0 : _j.markRead(packet.id, packet.message_id); | ||
(_h = this.client.unreads) === null || _h === void 0 ? void 0 : _h.markRead(packet.id, packet.message_id); | ||
break; | ||
@@ -456,0 +462,0 @@ } |
@@ -90,3 +90,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const process = (packet) => __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
this.client.emit("packet", packet); | ||
@@ -253,3 +253,9 @@ try { | ||
const msg = this.client.messages.get(packet.id); | ||
(_b = msg === null || msg === void 0 ? void 0 : msg.reactions.get(packet.emoji_id)) === null || _b === void 0 ? void 0 : _b.delete(packet.user_id); | ||
const user_ids = msg === null || msg === void 0 ? void 0 : 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; | ||
@@ -300,4 +306,4 @@ } | ||
case "ChannelGroupJoin": { | ||
(_c = this.client.channels | ||
.get(packet.id)) === null || _c === void 0 ? void 0 : _c.updateGroupJoin(packet.user); | ||
(_b = this.client.channels | ||
.get(packet.id)) === null || _b === void 0 ? void 0 : _b.updateGroupJoin(packet.user); | ||
break; | ||
@@ -308,3 +314,3 @@ } | ||
if (channel) { | ||
if (packet.user === ((_d = this.client.user) === null || _d === void 0 ? void 0 : _d._id)) { | ||
if (packet.user === ((_c = this.client.user) === null || _c === void 0 ? void 0 : _c._id)) { | ||
channel.delete(true); | ||
@@ -394,3 +400,3 @@ } | ||
if (server) { | ||
const role = Object.assign(Object.assign({}, (_e = server.roles) === null || _e === void 0 ? void 0 : _e[packet.role_id]), packet.data); | ||
const role = Object.assign(Object.assign({}, (_d = server.roles) === null || _d === void 0 ? void 0 : _d[packet.role_id]), packet.data); | ||
server.roles = Object.assign(Object.assign({}, server.roles), { [packet.role_id]: role }); | ||
@@ -404,3 +410,3 @@ this.client.emit("role/update", packet.role_id, role, packet.id); | ||
if (server) { | ||
const _k = (_f = server.roles) !== null && _f !== void 0 ? _f : {}, _l = packet.role_id, _ = _k[_l], roles = __rest(_k, [typeof _l === "symbol" ? _l : _l + ""]); | ||
const _j = (_e = server.roles) !== null && _e !== void 0 ? _e : {}, _k = packet.role_id, _ = _j[_k], roles = __rest(_j, [typeof _k === "symbol" ? _k : _k + ""]); | ||
server.roles = roles; | ||
@@ -412,4 +418,4 @@ this.client.emit("role/delete", packet.role_id, packet.id); | ||
case "UserUpdate": { | ||
(_g = this.client.users | ||
.get(packet.id)) === null || _g === void 0 ? void 0 : _g.update(packet.data, packet.clear); | ||
(_f = this.client.users | ||
.get(packet.id)) === null || _f === void 0 ? void 0 : _f.update(packet.data, packet.clear); | ||
break; | ||
@@ -440,4 +446,4 @@ } | ||
case "ChannelStopTyping": { | ||
(_h = this.client.channels | ||
.get(packet.id)) === null || _h === void 0 ? void 0 : _h.updateStopTyping(packet.user); | ||
(_g = this.client.channels | ||
.get(packet.id)) === null || _g === void 0 ? void 0 : _g.updateStopTyping(packet.user); | ||
clearInterval(timeouts[packet.id + packet.user]); | ||
@@ -447,3 +453,3 @@ break; | ||
case "ChannelAck": { | ||
(_j = this.client.unreads) === null || _j === void 0 ? void 0 : _j.markRead(packet.id, packet.message_id); | ||
(_h = this.client.unreads) === null || _h === void 0 ? void 0 : _h.markRead(packet.id, packet.message_id); | ||
break; | ||
@@ -450,0 +456,0 @@ } |
{ | ||
"name": "revolt.js", | ||
"version": "6.0.11", | ||
"version": "6.0.12", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
485478
13490