mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
Update CHANNEL_UPDATE.ts
This commit is contained in:
@@ -7,11 +7,10 @@ import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
|||||||
export async function handleChannelUpdate(data: DiscordGatewayPayload) {
|
export async function handleChannelUpdate(data: DiscordGatewayPayload) {
|
||||||
const payload = data.d as Channel;
|
const payload = data.d as Channel;
|
||||||
const cachedChannel = await cacheHandlers.get("channels", payload.id);
|
const cachedChannel = await cacheHandlers.get("channels", payload.id);
|
||||||
|
if (!cachedChannel) return;
|
||||||
|
|
||||||
const discordenoChannel = await structures.createDiscordenoChannel(payload);
|
const discordenoChannel = await structures.createDiscordenoChannel(payload);
|
||||||
await cacheHandlers.set("channels", discordenoChannel.id, discordenoChannel);
|
await cacheHandlers.set("channels", discordenoChannel.id, discordenoChannel);
|
||||||
|
|
||||||
if (!cachedChannel) return;
|
|
||||||
|
|
||||||
eventHandlers.channelUpdate?.(discordenoChannel, cachedChannel);
|
eventHandlers.channelUpdate?.(discordenoChannel, cachedChannel);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user