mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
Update handle_on_message.ts
This commit is contained in:
@@ -8,6 +8,7 @@ import { delay } from "../util/utils.ts";
|
||||
import { decompressWith } from "./deps.ts";
|
||||
import { identify } from "./identify.ts";
|
||||
import { resume } from "./resume.ts";
|
||||
import { sendShardMessage } from "./send_shard_message.ts";
|
||||
import { ws } from "./ws.ts";
|
||||
|
||||
/** Handler for handling every message event from websocket. */
|
||||
@@ -38,11 +39,10 @@ export async function handleOnMessage(message: any, shardId: number) {
|
||||
|
||||
shard.heartbeat.lastSentAt = Date.now();
|
||||
// Discord randomly sends this requiring an immediate heartbeat back
|
||||
shard.queue.unshift({
|
||||
sendShardMessage(shard, {
|
||||
op: DiscordGatewayOpcodes.Heartbeat,
|
||||
d: shard?.previousSequenceNumber,
|
||||
});
|
||||
ws.processQueue(shard.id);
|
||||
}, true);
|
||||
break;
|
||||
case DiscordGatewayOpcodes.Hello:
|
||||
ws.heartbeat(
|
||||
|
||||
Reference in New Issue
Block a user