mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
autoconvert handler messages
This commit is contained in:
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import { IntegrationCreateUpdate } from "../../types/integration/integration_create_update.ts";
|
||||
import {
|
||||
DiscordIntegrationDelete,
|
||||
} from "../../types/integration/integration_delete.ts";
|
||||
import { snakeKeysToCamelCase } from "../../util/utils.ts";
|
||||
import { IntegrationDelete } from "../../types/integration/integration_delete.ts";
|
||||
|
||||
export function handleIntegrationDelete(data: DiscordGatewayPayload) {
|
||||
eventHandlers.integrationDelete?.(
|
||||
snakeKeysToCamelCase<IntegrationCreateUpdate>(
|
||||
data.d as DiscordIntegrationDelete,
|
||||
),
|
||||
data.d as IntegrationDelete,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
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,
|
||||
),
|
||||
data.d as IntegrationCreateUpdate,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user