Files
discordeno/handlers/messages/MESSAGE_CREATE.ts
T
2022-02-11 09:49:53 +00:00

11 lines
471 B
TypeScript

import { Bot } from "../../bot.ts";
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
import type { Message } from "../../types/messages/message.ts";
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
export async function handleMessageCreate(bot: Bot, data: DiscordGatewayPayload) {
const payload = data.d as SnakeCasedPropertiesDeep<Message>;
bot.events.messageCreate(bot, bot.transformers.message(bot, payload));
}