This commit is contained in:
ITOH
2021-04-12 09:30:45 +02:00
parent 51e27d8f17
commit b9bd29ebf8
44 changed files with 268 additions and 221 deletions
@@ -1,15 +1,15 @@
import { eventHandlers } from "../../bot.ts";
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
import { IntegrationCreateUpdate } from "../../types/integration/integration_create_update.ts";
import {
DiscordIntegrationDelete,
IntegrationDelete,
} from "../../types/integration/integration_delete.ts";
import { snakeKeysToCamelCase } from "../../util/utils.ts";
export function handleIntegrationDelete(data: DiscordGatewayPayload) {
const payload = data.d as DiscordIntegrationDelete;
eventHandlers.integrationDelete?.(
snakeKeysToCamelCase(payload) as IntegrationDelete,
snakeKeysToCamelCase<IntegrationCreateUpdate>(
data.d as DiscordIntegrationDelete,
),
);
}