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
@@ -1,17 +1,13 @@
import { eventHandlers } from "../../bot.ts";
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
import {
DiscordIntegrationCreateUpdate,
IntegrationCreateUpdate,
} from "../../types/integration/integration_create_update.ts";
import { snakeKeysToCamelCase } from "../../util/utils.ts";
export function handleIntegrationCreate(
data: DiscordGatewayPayload,
) {
eventHandlers.integrationCreate?.(
snakeKeysToCamelCase<IntegrationCreateUpdate>(
data.d as DiscordIntegrationCreateUpdate,
),
data.d as IntegrationCreateUpdate,
);
}