mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
fix(controllers/READY): reimplement guild cache mechanism (#647)
* add lastShardID * fix ready event controller * forgot to push this file * move ready to its own file * some changes * Update READY.ts * some changes idk if they are good * Update options.ts * Update READY.ts * Update guilds.ts
This commit is contained in:
+5
-2
@@ -6,13 +6,12 @@ import {
|
||||
DiscordPayload,
|
||||
FetchMembersOptions,
|
||||
GatewayOpcode,
|
||||
GatewayStatusUpdatePayload,
|
||||
ReadyPayload,
|
||||
} from "../types/mod.ts";
|
||||
import { Collection } from "../util/collection.ts";
|
||||
import { delay } from "../util/utils.ts";
|
||||
import { decompressWith } from "./deps.ts";
|
||||
import { handleDiscordPayload } from "./shard_manager.ts";
|
||||
import { Collection } from "../util/collection.ts";
|
||||
|
||||
export const basicShards = new Collection<number, BasicShard>();
|
||||
const heartbeating = new Map<number, boolean>();
|
||||
@@ -27,6 +26,8 @@ export interface BasicShard {
|
||||
sessionID: string;
|
||||
previousSequenceNumber: number | null;
|
||||
needToResume: boolean;
|
||||
ready: boolean;
|
||||
unavailableGuildIDs: Set<string>;
|
||||
}
|
||||
|
||||
interface RequestMemberQueuedRequest {
|
||||
@@ -53,6 +54,8 @@ export function createShard(
|
||||
sessionID: oldShard?.sessionID || "",
|
||||
previousSequenceNumber: oldShard?.previousSequenceNumber || 0,
|
||||
needToResume: false,
|
||||
ready: false,
|
||||
unavailableGuildIDs: new Set<string>(),
|
||||
};
|
||||
|
||||
basicShards.set(basicShard.id, basicShard);
|
||||
|
||||
Reference in New Issue
Block a user