From 39b6334f7e06bb7857f0e0ff11a7e21b9700a3fe Mon Sep 17 00:00:00 2001 From: MARCROCK22 <57925328+MARCROCK22@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:27:08 -0400 Subject: [PATCH] feat: add DiscordDark and DIscordLight to EmbedColors enum --- src/common/it/constants.ts | 2 ++ src/websocket/discord/shard.ts | 15 +-------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/common/it/constants.ts b/src/common/it/constants.ts index 50b4246..b1fa8b7 100644 --- a/src/common/it/constants.ts +++ b/src/common/it/constants.ts @@ -29,6 +29,8 @@ export enum EmbedColors { Greyple = 0x99aab5, DarkButNotBlack = 0x2c2f33, NotQuiteBlack = 0x23272a, + DiscordDark = 0x313338, + DiscordLight = 0xf9f9f9, } export const DiscordEpoch = 1420070400000n; diff --git a/src/websocket/discord/shard.ts b/src/websocket/discord/shard.ts index 98e3dd6..1573835 100644 --- a/src/websocket/discord/shard.ts +++ b/src/websocket/discord/shard.ts @@ -307,20 +307,7 @@ export class Shard { if (data instanceof Buffer) { data = inflateSync(data); } - /** - * Idk why, but Bun sends this event when websocket connects. - * MessageEvent { - * type: "message", - * data: "Already authenticated." - * } - */ - if ((data as string).startsWith('{')) { - data = JSON.parse(data as string); - } - - const packet = data as unknown as GatewayReceivePayload; - - return this.onpacket(packet); + return this.onpacket(JSON.parse(data as string)); } checkOffline(priority: number) {