mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
just fmt
This commit is contained in:
@@ -22,7 +22,6 @@ export async function handleGuildDelete(
|
|||||||
if (payload.unavailable) {
|
if (payload.unavailable) {
|
||||||
const shard = ws.shards.get(shardId);
|
const shard = ws.shards.get(shardId);
|
||||||
if (shard) shard.unavailableGuildIds.add(guild.id);
|
if (shard) shard.unavailableGuildIds.add(guild.id);
|
||||||
|
|
||||||
await cacheHandlers.set("unavailableGuilds", guild.id, Date.now());
|
await cacheHandlers.set("unavailableGuilds", guild.id, Date.now());
|
||||||
|
|
||||||
eventHandlers.guildUnavailable?.(guild);
|
eventHandlers.guildUnavailable?.(guild);
|
||||||
|
|||||||
+10
-10
@@ -17,7 +17,7 @@ import { tellClusterToIdentify } from "./tell_cluster_to_identify.ts";
|
|||||||
|
|
||||||
// CONTROLLER LIKE INTERFACE FOR WS HANDLING
|
// CONTROLLER LIKE INTERFACE FOR WS HANDLING
|
||||||
export const ws = {
|
export const ws = {
|
||||||
/** The secret key authorization header the bot will expect when sending payloads */
|
/** The secret key authorization header the bot will expect when sending payloads. */
|
||||||
secretKey: "",
|
secretKey: "",
|
||||||
/** The url that all discord payloads for the dispatch type should be sent to. */
|
/** The url that all discord payloads for the dispatch type should be sent to. */
|
||||||
url: "",
|
url: "",
|
||||||
@@ -29,7 +29,7 @@ export const ws = {
|
|||||||
maxShards: 0,
|
maxShards: 0,
|
||||||
/** Whether or not the resharder should automatically switch to LARGE BOT SHARDING when you are above 100K servers. */
|
/** Whether or not the resharder should automatically switch to LARGE BOT SHARDING when you are above 100K servers. */
|
||||||
useOptimalLargeBotSharding: true,
|
useOptimalLargeBotSharding: true,
|
||||||
/** The amount of shards to load per cluster */
|
/** The amount of shards to load per cluster. */
|
||||||
shardsPerCluster: 25,
|
shardsPerCluster: 25,
|
||||||
/** The maximum amount of clusters to use for your bot. */
|
/** The maximum amount of clusters to use for your bot. */
|
||||||
maxClusters: 4,
|
maxClusters: 4,
|
||||||
@@ -96,7 +96,7 @@ export const ws = {
|
|||||||
createShard,
|
createShard,
|
||||||
/** Begins identification of the shard to discord. */
|
/** Begins identification of the shard to discord. */
|
||||||
identify,
|
identify,
|
||||||
/** Begins heartbeating of the shard to keep it alive */
|
/** Begins heartbeating of the shard to keep it alive. */
|
||||||
heartbeat,
|
heartbeat,
|
||||||
/** Sends the discord payload to another server. */
|
/** Sends the discord payload to another server. */
|
||||||
handleDiscordPayload,
|
handleDiscordPayload,
|
||||||
@@ -114,16 +114,16 @@ export const ws = {
|
|||||||
processQueue,
|
processQueue,
|
||||||
/** Closes shard WebSocket connection properly. */
|
/** Closes shard WebSocket connection properly. */
|
||||||
closeWS,
|
closeWS,
|
||||||
/** Properly adds a message to the shards queue */
|
/** Properly adds a message to the shards queue. */
|
||||||
sendShardMessage,
|
sendShardMessage,
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface DiscordenoShard {
|
export interface DiscordenoShard {
|
||||||
/** The shard id number */
|
/** The shard id number. */
|
||||||
id: number;
|
id: number;
|
||||||
/** The websocket for this shard */
|
/** The websocket for this shard. */
|
||||||
ws: WebSocket;
|
ws: WebSocket;
|
||||||
/** The amount of milliseconds to wait between heartbeats */
|
/** The amount of milliseconds to wait between heartbeats. */
|
||||||
resumeInterval: number;
|
resumeInterval: number;
|
||||||
/** The session id important for resuming connections. */
|
/** The session id important for resuming connections. */
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
@@ -131,12 +131,12 @@ export interface DiscordenoShard {
|
|||||||
previousSequenceNumber: number | null;
|
previousSequenceNumber: number | null;
|
||||||
/** Whether the shard is currently resuming. */
|
/** Whether the shard is currently resuming. */
|
||||||
resuming: boolean;
|
resuming: boolean;
|
||||||
/** Whether the shard has received the ready event */
|
/** Whether the shard has received the ready event. */
|
||||||
ready: boolean;
|
ready: boolean;
|
||||||
/** The list of guild ids that are currently unavailable due to an outage. */
|
/** The list of guild ids that are currently unavailable due to an outage. */
|
||||||
unavailableGuildIds: Set<bigint>;
|
unavailableGuildIds: Set<bigint>;
|
||||||
heartbeat: {
|
heartbeat: {
|
||||||
/** The exact timestamp the last heartbeat was sent */
|
/** The exact timestamp the last heartbeat was sent. */
|
||||||
lastSentAt: number;
|
lastSentAt: number;
|
||||||
/** The timestamp the last heartbeat ACK was received from discord. */
|
/** The timestamp the last heartbeat ACK was received from discord. */
|
||||||
lastReceivedAt: number;
|
lastReceivedAt: number;
|
||||||
@@ -155,7 +155,7 @@ export interface DiscordenoShard {
|
|||||||
processingQueue: boolean;
|
processingQueue: boolean;
|
||||||
/** When the first request for this minute has been sent. */
|
/** When the first request for this minute has been sent. */
|
||||||
queueStartedAt: number;
|
queueStartedAt: number;
|
||||||
/** The request counter of the queue */
|
/** The request counter of the queue. */
|
||||||
queueCounter: number;
|
queueCounter: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user