import { type CreateShard } from "https://deno.land/x/discordeno@17.0.1/mod.ts";
Properties
This function communicates with the management process, in order to know whether its free to identify. When this function resolves, this means that the shard is allowed to send an identify payload to discord.
Calculate the amount of requests which can safely be made per rate limit interval, before the gateway gets disconnected due to an exceeded rate limit.
Connect the shard with the gateway and start heartbeating. This will not identify the shard to the gateway.
Identify the shard to the gateway. If not connected, this will also connect the shard to the gateway.
The maximum of requests which can be send to discord per rate limit tick. Typically this value should not be changed.
In which interval (in milliseconds) the gateway resets it's rate limit.
Shutdown the shard. Forcefully disconnect the shard from Discord. The shard may not attempt to reconnect with Discord.
Cache for pending gateway requests which should have been send while the gateway went offline.