more handlers

This commit is contained in:
Skillz4Killz
2021-10-23 15:38:53 +00:00
committed by GitHub
parent cca34edaf9
commit 8b242c57aa
11 changed files with 289 additions and 112 deletions
+4 -3
View File
@@ -1,7 +1,8 @@
import { eventHandlers } from "../../bot.ts";
import { Bot } from "../../bot.ts";
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
import type { InviteCreate } from "../../types/invites/invite_create.ts";
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
export function handleInviteCreate(data: DiscordGatewayPayload) {
eventHandlers.inviteCreate?.(data.d as InviteCreate);
export function handleInviteCreate(bot: Bot, data: DiscordGatewayPayload) {
bot.events.inviteCreate(bot, bot.transformers.invite(bot, data.d as SnakeCasedPropertiesDeep<InviteCreate>));
}