Skip to content

Commit

Permalink
add entitlements
Browse files Browse the repository at this point in the history
  • Loading branch information
Starman3787 committed Oct 21, 2023
1 parent daa82d7 commit ec058da
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
24 changes: 24 additions & 0 deletions src/gateway/eventHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit ec058da

Please sign in to comment.