mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 00:40:07 +00:00
fix: get rid of type errors for now (#2113)
This commit is contained in:
3
plugins/cache/src/dispatchRequirements.ts
vendored
3
plugins/cache/src/dispatchRequirements.ts
vendored
@@ -1,3 +1,4 @@
|
||||
import type { Guild } from "../deps.ts";
|
||||
import { Bot, DiscordGatewayPayload } from "../deps.ts";
|
||||
import { BotWithCache } from "./addCacheCollections.ts";
|
||||
|
||||
@@ -55,7 +56,7 @@ export async function dispatchRequirements<B extends Bot>(
|
||||
.getGuild(id, {
|
||||
counts: true,
|
||||
})
|
||||
.catch(console.log));
|
||||
.catch(console.log)) as Guild;
|
||||
|
||||
if (!guild) {
|
||||
processing.delete(id);
|
||||
|
||||
10
plugins/cache/src/setupCacheRemovals.ts
vendored
10
plugins/cache/src/setupCacheRemovals.ts
vendored
@@ -1,3 +1,5 @@
|
||||
import type { Emoji, Guild } from "../deps.ts";
|
||||
import type { BotWithCache } from "./addCacheCollections.ts";
|
||||
import {
|
||||
Bot,
|
||||
Collection,
|
||||
@@ -10,7 +12,6 @@ import {
|
||||
DiscordMessageDeleteBulk,
|
||||
DiscordUnavailableGuild,
|
||||
} from "../deps.ts";
|
||||
import { BotWithCache } from "./addCacheCollections.ts";
|
||||
|
||||
export function setupCacheRemovals<B extends Bot>(bot: BotWithCache<B>) {
|
||||
const {
|
||||
@@ -67,10 +68,11 @@ export function setupCacheRemovals<B extends Bot>(bot: BotWithCache<B>) {
|
||||
bot.handlers.GUILD_EMOJIS_UPDATE = function (_, data, shardId) {
|
||||
const payload = data.d as DiscordGuildEmojisUpdate;
|
||||
|
||||
const guild = bot.guilds.get(bot.transformers.snowflake(payload.guild_id));
|
||||
const guild= bot.guilds.get(bot.transformers.snowflake(payload.guild_id));
|
||||
|
||||
if (guild) {
|
||||
guild.emojis = new Collection(payload.emojis.map((e) => {
|
||||
const emoji = bot.transformers.emoji(bot, e);
|
||||
guild.emojis! = new Collection(payload.emojis.map((e) => {
|
||||
const emoji: Emoji = bot.transformers.emoji(bot, e);
|
||||
return [emoji.id!, emoji];
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user