mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 08:50:07 +00:00
Merge pull request #1730 from TriForMine/patch-14
Fix: dispatchRequirements
This commit is contained in:
@@ -6,8 +6,6 @@ import { SnakeCasedPropertiesDeep } from "../types/util.ts";
|
||||
const processing = new Set<bigint>();
|
||||
|
||||
export async function dispatchRequirements(bot: Bot, data: DiscordGatewayPayload, shardId: number) {
|
||||
if (!bot.isReady) return;
|
||||
|
||||
// DELETE MEANS WE DONT NEED TO FETCH. CREATE SHOULD HAVE DATA TO CACHE
|
||||
if (data.t && ["GUILD_CREATE", "GUILD_DELETE"].includes(data.t)) return;
|
||||
|
||||
@@ -19,11 +17,11 @@ export async function dispatchRequirements(bot: Bot, data: DiscordGatewayPayload
|
||||
(data.d as any)?.guild_id) ?? ""
|
||||
);
|
||||
|
||||
if (!id || bot.activeGuildIds.has(id)) return;
|
||||
if (!id || bot.cache.activeGuildIds.has(id)) return;
|
||||
|
||||
// If this guild is in cache, it has not been swept and we can cancel
|
||||
if (await bot.cache.guilds.has(id)) {
|
||||
bot.activeGuildIds.add(id);
|
||||
bot.cache.activeGuildIds.add(id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user