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
@@ -1,9 +1,13 @@
import { botID, eventHandlers } from "../../bot.ts";
import { structures } from "../../structures/mod.ts";
import { cacheHandlers } from "../../cache.ts";
import { structures } from "../../structures/mod.ts";
import {
DiscordGatewayPayload,
DiscordMessageReactionAdd,
} from "../../types/gateway.ts";
export async function handleMessageReactionAdd(data: DiscordPayload) {
const payload = data.d as MessageReactionPayload;
export async function handleMessageReactionAdd(data: DiscordGatewayPayload) {
const payload = data.d as DiscordMessageReactionAdd;
const message = await cacheHandlers.get("messages", payload.message_id);
if (message) {