import { type CreateShard } from "https://deno.land/x/discordeno@17.2.0/template/minimal/deps.ts";
Properties
Gateway configuration for the shard.
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.
Current internal state of the shard.
The shard related event handlers.
This contains all the heartbeat information
Bucket for handling shard request rate limits.
Cache for pending gateway requests which should have been send while the gateway went offline.
This is used to resolve internal waiting states. Mapped by SelectedEvents => ResolveFunction
Methods
Function which can be overwritten in order to get the shards presence.