mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
making it testable
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
// import { eventHandlers } from "../../bot.ts";
|
||||
// import { cacheHandlers } from "../../cache.ts";
|
||||
import { Channel } from "../../types/channels/channel.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import { snowflakeToBigint } from "../../util/bigint.ts";
|
||||
|
||||
export async function handleThreadDelete(data: DiscordGatewayPayload) {
|
||||
const payload = data.d as Channel;
|
||||
// const payload = data.d as Channel;
|
||||
|
||||
const cachedChannel = await cacheHandlers.get("threads", snowflakeToBigint(payload.id));
|
||||
if (!cachedChannel) return;
|
||||
// const cachedChannel = await cacheHandlers.get("threads", snowflakeToBigint(payload.id));
|
||||
// if (!cachedChannel) return;
|
||||
|
||||
await cacheHandlers.delete("threads", snowflakeToBigint(payload.id));
|
||||
await cacheHandlers.forEach("DELETE_MESSAGES_FROM_CHANNEL", { channelId: snowflakeToBigint(payload.id) });
|
||||
// await cacheHandlers.delete("threads", snowflakeToBigint(payload.id));
|
||||
// await cacheHandlers.forEach("DELETE_MESSAGES_FROM_CHANNEL", { channelId: snowflakeToBigint(payload.id) });
|
||||
|
||||
eventHandlers.threadDelete?.(cachedChannel);
|
||||
// eventHandlers.threadDelete?.(cachedChannel);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user