Update THREAD_UPDATE.ts

This commit is contained in:
ITOH
2021-05-03 21:46:30 +02:00
parent c2175cc339
commit 781a3e71c0
+5 -1
View File
@@ -3,10 +3,14 @@ import { cacheHandlers } from "../../cache.ts";
import { structures } from "../../structures/mod.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 handleThreadUpdate(data: DiscordGatewayPayload) {
const payload = data.d as Channel;
const oldChannel = await cacheHandlers.get("channels", payload.id);
const oldChannel = await cacheHandlers.get(
"channels",
snowflakeToBigint(payload.id),
);
if (!oldChannel) return;
const discordenoChannel = await structures.createDiscordenoChannel(payload);