types: add gateway types

This commit is contained in:
ayntee
2021-03-27 12:37:11 +04:00
parent b1512e0334
commit 72b07574f2
16 changed files with 229 additions and 31 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 handleUserUpdate(data: DiscordPayload) {
const userData = data.d as UserPayload;
export async function handleUserUpdate(data: DiscordGatewayPayload) {
const userData = data.d as DiscordUser;
const member = await cacheHandlers.get("members", userData.id);
if (!member) return;