Skip to content

Commit

Permalink
Debug Identifier should be numbers not strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Didas-git committed May 28, 2024
1 parent 3466513 commit 8379158
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lilybird",
"version": "0.7.1",
"version": "0.7.2",
"description": "A bun-first discord client written in TS",
"main": "./dist/index.js",
"author": "DidaS",
Expand Down
32 changes: 16 additions & 16 deletions packages/core/src/enums/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ export const enum TransformerReturnType {
}

export const enum DebugIdentifier {
Message = "WS_MESSAGE",
Heartbeat = "HEARTBEAT",
ACK = "ACK",
HeartbeatRequest = "NEED_HEARTBEAT",
Identify = "IDENTIFY",
Resume = "RESUME",
InvalidSession = "INVALID_SESSION",
Reconnect = "RECONNECT",
WSError = "ERROR",
MissingACK = "MISSING_ACK",
ZombieConnection = "ZOMBIE",
AttemptingResume = "ATTEMPTING_RESUME",
CloseCode = "CLOSE_CODE",
CompiledListeners = "LISTENERS",
RESTCall = "REST_IN",
RESTError = "REST_ERROR"
WSMessage,
Heartbeat,
ACK,
HeartbeatRequest,
Identify,
Resume,
InvalidSession,
Reconnect,
WSError,
MissingACK,
ZombieConnection,
AttemptingResume,
CloseCode,
CompiledListeners,
RESTCall,
RESTError
}
2 changes: 1 addition & 1 deletion packages/core/src/ws/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class WebSocketManager {
await this.connect();
});
this.#ws.addEventListener("message", (event) => {
this.#debug?.(DebugIdentifier.Message, event.data);
this.#debug?.(DebugIdentifier.WSMessage, event.data);
const payload = <Payload>JSON.parse((event.data as Buffer).toString());
if (typeof payload.s === "number") this.#sequenceNumber = payload.s;

Expand Down

0 comments on commit 8379158

Please sign in to comment.