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,6 +1,10 @@
import { eventHandlers } from "../../bot.ts";
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
import { DiscordApplicationCommandCreateUpdateDelete } from "../../types/interactions/application_command_create_update_delete.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 {
@@ -9,9 +13,9 @@ export function handleApplicationCommandUpdate(data: DiscordGatewayPayload) {
...rest
} = data.d as DiscordApplicationCommandCreateUpdateDelete;
eventHandlers.applicationCommandUpdate?.({
...rest,
guildId,
applicationId,
});
eventHandlers.applicationCommandUpdate?.(
snakeKeysToCamelCase<ApplicationCommandCreateUpdateDelete>(
data.d as DiscordApplicationCommandCreateUpdateDelete,
),
);
}