Files
discordeno/src/handlers/integrations/INTEGRATION_UPDATE.ts
T
2021-04-12 09:30:45 +02:00

16 lines
541 B
TypeScript

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 handleIntegrationUpdate(data: DiscordGatewayPayload) {
eventHandlers.integrationUpdate?.(
snakeKeysToCamelCase<IntegrationCreateUpdate>(
data.d as DiscordIntegrationCreateUpdate,
),
);
}