diff --git a/module/shard.ts b/module/shard.ts index 9077c244a..9307fc54c 100644 --- a/module/shard.ts +++ b/module/shard.ts @@ -18,6 +18,7 @@ export const createShard = async ( JSON.stringify({ op: GatewayOpcode.Identify, d: identifyPayload }), ); for await (const message of shardSocket) { + console.log("inside socket", message); if (typeof message === "string") { handleDiscordPayload(JSON.parse(message), shardSocket, resumeInterval); } else if (isWebSocketCloseEvent(message)) { diff --git a/module/shardingManager.ts b/module/shardingManager.ts index 905b2b065..9feef631d 100644 --- a/module/shardingManager.ts +++ b/module/shardingManager.ts @@ -62,10 +62,9 @@ let sessionID = ""; let shardCounter = 0; function createShardWorker() { - const shard = new Worker( - "https://raw.githubusercontent.com/Skillz4Killz/Discordeno/master/module/shard.ts", - { type: "module", deno: true }, - ); + const path = new URL("./shard.ts", import.meta.url).toString(); + console.log("path", path); + const shard = new Worker(path, { type: "module", deno: true }); shard.onmessage = (message) => { if (message.data.type === "REQUEST_CLIENT_OPTIONS") { identifyPayload.shard = [shardCounter++, botGatewayData.shards]; @@ -92,6 +91,7 @@ export function handleDiscordPayload( socket: WebSocket, resumeInterval: number, ) { + console.log("inside handle discord payloa", data); // Update the sequence number if it is present if (data.s) updatePreviousSequenceNumber(data.s); eventHandlers.raw?.(data);