mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
autoconvert handler messages
This commit is contained in:
@@ -2,16 +2,12 @@ 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 handleApplicationCommandCreate(
|
||||
data: DiscordGatewayPayload,
|
||||
) {
|
||||
eventHandlers.applicationCommandCreate?.(
|
||||
snakeKeysToCamelCase<ApplicationCommandCreateUpdateDelete>(
|
||||
data.d as DiscordApplicationCommandCreateUpdateDelete,
|
||||
),
|
||||
data.d as ApplicationCommandCreateUpdateDelete,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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 handleApplicationCommandUpdate(data: DiscordGatewayPayload) {
|
||||
eventHandlers.applicationCommandUpdate?.(
|
||||
snakeKeysToCamelCase<ApplicationCommandCreateUpdateDelete>(
|
||||
data.d as DiscordApplicationCommandCreateUpdateDelete,
|
||||
),
|
||||
data.d as ApplicationCommandCreateUpdateDelete,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user