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
@@ -2,14 +2,10 @@ import { eventHandlers } from "../../bot.ts";
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
import {
ApplicationCommandCreateUpdateDelete,
DiscordApplicationCommandCreateUpdateDelete,
} from "../../types/interactions/application_command_create_update_delete.ts";
import { snakeKeysToCamelCase } from "../../util/utils.ts";
export function handleApplicationCommandDelete(data: DiscordGatewayPayload) {
eventHandlers.applicationCommandDelete?.(
snakeKeysToCamelCase<ApplicationCommandCreateUpdateDelete>(
data.d as DiscordApplicationCommandCreateUpdateDelete,
),
data.d as ApplicationCommandCreateUpdateDelete,
);
}