autoconvert handler messages

This commit is contained in:
ITOH
2021-04-24 23:17:11 +02:00
parent 6d4c51a4eb
commit be2bbbdd99
54 changed files with 181 additions and 248 deletions
+3 -3
View File
@@ -1,11 +1,11 @@
import { eventHandlers } from "../../bot.ts";
import { cacheHandlers } from "../../cache.ts";
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
import { DiscordMessageDelete } from "../../types/messages/message_delete.ts";
import { MessageDelete } from "../../types/messages/message_delete.ts";
export async function handleMessageDelete(data: DiscordGatewayPayload) {
const payload = data.d as DiscordMessageDelete;
const channel = await cacheHandlers.get("channels", payload.channel_id);
const payload = data.d as MessageDelete;
const channel = await cacheHandlers.get("channels", payload.channelId);
if (!channel) return;
eventHandlers.messageDelete?.(