mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
fix
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
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 handleApplicationCommandCreate(
|
||||
data: DiscordGatewayPayload,
|
||||
) {
|
||||
const {
|
||||
guild_id: guildId,
|
||||
application_id: applicationId,
|
||||
...rest
|
||||
} = data.d as DiscordApplicationCommandCreateUpdateDelete;
|
||||
|
||||
eventHandlers.applicationCommandCreate?.({
|
||||
...rest,
|
||||
guildId,
|
||||
applicationId,
|
||||
});
|
||||
eventHandlers.applicationCommandCreate?.(
|
||||
snakeKeysToCamelCase<ApplicationCommandCreateUpdateDelete>(
|
||||
data.d as DiscordApplicationCommandCreateUpdateDelete,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
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 handleApplicationCommandDelete(data: DiscordGatewayPayload) {
|
||||
const {
|
||||
application_id: applicationId,
|
||||
guild_id: guildId,
|
||||
...rest
|
||||
} = data.d as DiscordApplicationCommandCreateUpdateDelete;
|
||||
|
||||
eventHandlers.applicationCommandDelete?.({
|
||||
...rest,
|
||||
guildId,
|
||||
applicationId,
|
||||
});
|
||||
eventHandlers.applicationCommandDelete?.(
|
||||
snakeKeysToCamelCase<ApplicationCommandCreateUpdateDelete>(
|
||||
data.d as DiscordApplicationCommandCreateUpdateDelete,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user