mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
fix: stop gateway ts errors
This commit is contained in:
@@ -1,13 +1,18 @@
|
|||||||
/** Use this function to stop the gateway properly */
|
import { delay } from "../util/utils.ts";
|
||||||
export async function stopGateway(gateway: GatewayManager, code = 3061, reason = "Discordeno Testing Finished! Do Not RESUME!") {
|
import { GatewayManager } from "./gateway_manager.ts";
|
||||||
|
|
||||||
|
/** Use this function to stop the gateway properly */
|
||||||
|
export async function stopGateway(
|
||||||
|
gateway: GatewayManager,
|
||||||
|
code = 3061,
|
||||||
|
reason = "Discordeno Testing Finished! Do Not RESUME!",
|
||||||
|
) {
|
||||||
// STOP WS
|
// STOP WS
|
||||||
gateway.shards.forEach((shard) => {
|
gateway.shards.forEach((shard) => {
|
||||||
clearInterval(shard.heartbeat.intervalId);
|
clearInterval(shard.heartbeat.intervalId);
|
||||||
gateway.closeWS(
|
gateway.closeWS(
|
||||||
shard.ws,
|
shard.ws,
|
||||||
code,
|
code,
|
||||||
|
|
||||||
reason,
|
reason,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user