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
+4 -3
View File
@@ -1,9 +1,10 @@
import { eventHandlers } from "../../bot.ts";
import { structures } from "../../structures/mod.ts";
import { cacheHandlers } from "../../cache.ts";
import { structures } from "../../structures/mod.ts";
import { DiscordGatewayPayload } from "../../types/gateway.ts";
export async function handleMessageCreate(data: DiscordPayload) {
const payload = data.d as MessageCreateOptions;
export async function handleMessageCreate(data: DiscordGatewayPayload) {
const payload = data.d as DiscordMessage;
const channel = await cacheHandlers.get("channels", payload.channel_id);
if (channel) channel.lastMessageID = payload.id;