types: add gateway events types

This commit is contained in:
ayntee
2021-03-27 12:03:55 +04:00
parent 68c0aa4877
commit b1512e0334
30 changed files with 316 additions and 78 deletions
+3 -2
View File
@@ -1,8 +1,9 @@
import { eventHandlers } from "../../bot.ts";
import { cacheHandlers } from "../../cache.ts";
import { DiscordGatewayPayload } from "../../types/gateway.ts";
export async function handleChannelDelete(data: DiscordPayload) {
const payload = data.d as ChannelCreatePayload;
export async function handleChannelDelete(data: DiscordGatewayPayload) {
const payload = data.d as DiscordChannel;
const cachedChannel = await cacheHandlers.get("channels", payload.id);
if (!cachedChannel) return;