summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorCyberL1 <cyber.hf18@gmail.com>2025-10-23 07:41:42 +0200
committerCyberL1 <cyber.hf18@gmail.com>2025-10-23 07:41:42 +0200
commit2d6e5c8481cc40f72579981971d462e907707aa6 (patch)
treebc8285e7488ff89eca63e762bc3f5ebabc946fc1 /src/api
parentfix dming blocked users (diff)
downloadserver-ts-2d6e5c8481cc40f72579981971d462e907707aa6.tar.xz
fix: complete `applicationCommandSendable`
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/guilds/#guild_id/application-command-index.ts22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/api/routes/guilds/#guild_id/application-command-index.ts b/src/api/routes/guilds/#guild_id/application-command-index.ts

index 6c5a5ffe..dbf7ce6c 100644 --- a/src/api/routes/guilds/#guild_id/application-command-index.ts +++ b/src/api/routes/guilds/#guild_id/application-command-index.ts
@@ -20,6 +20,7 @@ import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; import { Application, ApplicationCommand, Member, Snowflake } from "@spacebar/util"; import { IsNull } from "typeorm"; +import { ApplicationCommandSchema } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); @@ -52,19 +53,30 @@ router.get("/", route({}), async (req: Request, res: Response) => { applicationCommands.push(await ApplicationCommand.find({ where: { application_id: application.id, guild_id: req.params.guild_id } })); } - const applicationCommandsSendable = []; + const applicationCommandsSendable: ApplicationCommandSchema[] = []; for (const command of applicationCommands.flat()) { applicationCommandsSendable.push({ + id: command.id, + type: command.type, application_id: command.application_id, + guild_id: command.guild_id, + name: command.name, + name_localizations: command.name_localizations, + // name_localized: // TODO: make this work description: command.description, + description_localizations: command.description_localizations, + // description_localized: // TODO: make this work + options: command.options, + default_member_permissions: command.default_member_permissions, dm_permission: command.dm_permission, - global_popularity_rank: command.global_popularity_rank, - id: command.id, + permissions: command.permissions, + nsfw: command.nsfw, integration_types: command.integration_types, - name: command.name, - type: command.type, + global_popularity_rank: command.global_popularity_rank, + contexts: command.contexts, version: command.version, + handler: command.handler, }); }