From ec058da2db7575f6d5e13029be2c653d7eaae0f9 Mon Sep 17 00:00:00 2001 From: Starman <30315137+Starman3787@users.noreply.github.com> Date: Sat, 21 Oct 2023 13:44:41 +0100 Subject: [PATCH] add entitlements --- src/constants.js | 5 ++++- src/gateway/eventHandler.js | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/constants.js b/src/constants.js index cf487a95c..313a8e9a4 100644 --- a/src/constants.js +++ b/src/constants.js @@ -58,7 +58,10 @@ module.exports.EVENTS = { INVITE_DELETE: ("inviteDelete"), GUILD_ROLE_CREATE: ("roleCreate"), GUILD_ROLE_UPDATE: ("roleUpdate"), - GUILD_ROLE_DELETE: ("roleDelete") + GUILD_ROLE_DELETE: ("roleDelete"), + ENTITLEMENT_CREATE: ("entitlementCreate"), + ENTITLEMENT_UPDATE: ("entitlementUpdate"), + ENTITLEMENT_DELETE: ("entitlementDelete") }; module.exports.CHANNEL_TYPES = { GUILD_TEXT: (0), diff --git a/src/gateway/eventHandler.js b/src/gateway/eventHandler.js index 7fa77d0d1..6fbfbb4dd 100644 --- a/src/gateway/eventHandler.js +++ b/src/gateway/eventHandler.js @@ -422,6 +422,30 @@ class EventHandler { } + ENTITLEMENT_CREATE(data) { + + this.client.emit("debug", `${this.ws.libName} ${this.ws.shardNorminal} @ ${this.ws.time()} => ENTITLEMENT_CREATE ${data.user_id}`); + + this.client.emit(EVENTS.ENTITLEMENT_CREATE, data); + + } + + ENTITLEMENT_UPDATE(data) { + + this.client.emit("debug", `${this.ws.libName} ${this.ws.shardNorminal} @ ${this.ws.time()} => ENTITLEMENT_UPDATE ${data.user_id}`); + + this.client.emit(EVENTS.ENTITLEMENT_UPDATE, data); + + } + + ENTITLEMENT_DELETE(data) { + + this.client.emit("debug", `${this.ws.libName} ${this.ws.shardNorminal} @ ${this.ws.time()} => ENTITLEMENT_DELETE ${data.user_id}`); + + this.client.emit(EVENTS.ENTITLEMENT_DELETE, data); + + } + } module.exports = EventHandler; \ No newline at end of file