summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2025-10-22 12:00:05 -0500
committerMathMan05 <mathmanrm@gmail.com>2025-10-22 12:00:05 -0500
commitfa295314df22ee7dfbeb5084e2d7b4b0a5d0fed0 (patch)
tree6589b3ca04ff5ff8d20a34e63f9cdccba085fb30 /src/api
parentI think this fixes bugs (diff)
downloadserver-ts-fa295314df22ee7dfbeb5084e2d7b4b0a5d0fed0.tar.xz
reduce a little
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/guilds/#guild_id/application-command-index.ts9
1 files changed, 4 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 54db496c5..6c5a5ffe9 100644 --- a/src/api/routes/guilds/#guild_id/application-command-index.ts +++ b/src/api/routes/guilds/#guild_id/application-command-index.ts
@@ -45,17 +45,16 @@ router.get("/", route({}), async (req: Request, res: Response) => { }); } - const globalApplicationCommands: ApplicationCommand[][] = []; - const guildApplicationCommands: ApplicationCommand[][] = []; + const applicationCommands: ApplicationCommand[][] = []; for (const application of applications) { - globalApplicationCommands.push(await ApplicationCommand.find({ where: { application_id: application.id, guild_id: IsNull() } })); - guildApplicationCommands.push(await ApplicationCommand.find({ where: { application_id: application.id, guild_id: req.params.guild_id } })); + applicationCommands.push(await ApplicationCommand.find({ where: { application_id: application.id, guild_id: IsNull() } })); + applicationCommands.push(await ApplicationCommand.find({ where: { application_id: application.id, guild_id: req.params.guild_id } })); } const applicationCommandsSendable = []; - for (const command of [...globalApplicationCommands, ...guildApplicationCommands].flat()) { + for (const command of applicationCommands.flat()) { applicationCommandsSendable.push({ application_id: command.application_id, description: command.description,