mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
pushing fixes
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user