mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
22 lines
765 B
TypeScript
22 lines
765 B
TypeScript
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) {
|
|
const {
|
|
application_id: applicationId,
|
|
guild_id: guildId,
|
|
...rest
|
|
} = data.d as DiscordApplicationCommandCreateUpdateDelete;
|
|
|
|
eventHandlers.applicationCommandUpdate?.(
|
|
snakeKeysToCamelCase<ApplicationCommandCreateUpdateDelete>(
|
|
data.d as DiscordApplicationCommandCreateUpdateDelete,
|
|
),
|
|
);
|
|
}
|