Update CHANNEL_UPDATE.ts

This commit is contained in:
ITOH
2021-05-02 20:50:46 +02:00
parent f0ea01b502
commit 1b7c777aa3
+1 -2
View File
@@ -7,11 +7,10 @@ import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
export async function handleChannelUpdate(data: DiscordGatewayPayload) {
const payload = data.d as Channel;
const cachedChannel = await cacheHandlers.get("channels", payload.id);
if (!cachedChannel) return;
const discordenoChannel = await structures.createDiscordenoChannel(payload);
await cacheHandlers.set("channels", discordenoChannel.id, discordenoChannel);
if (!cachedChannel) return;
eventHandlers.channelUpdate?.(discordenoChannel, cachedChannel);
}