mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
ad8a9920ac
* Move the shard stopping to gatewayManager in order to stop the gateway standalone. * Update gateway/gateway_manager.ts Co-authored-by: ITOH <to@itoh.at> * Update gateway/stopGateway.ts Co-authored-by: ITOH <to@itoh.at> * Update gateway/stopGateway.ts * Update gateway/stopGateway.ts * Update gateway/stopGateway.ts Co-authored-by: ITOH <to@itoh.at> Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
17 lines
434 B
TypeScript
17 lines
434 B
TypeScript
/** 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
|
|
gateway.shards.forEach((shard) => {
|
|
clearInterval(shard.heartbeat.intervalId);
|
|
gateway.closeWS(
|
|
shard.ws,
|
|
code,
|
|
|
|
reason,
|
|
);
|
|
});
|
|
|
|
await delay(5000);
|
|
}
|