reduce a little
This commit is contained in:
parent
a01f48b02b
commit
fa295314df
@ -45,17 +45,16 @@ router.get("/", route({}), async (req: Request, res: Response) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const globalApplicationCommands: ApplicationCommand[][] = [];
|
const applicationCommands: ApplicationCommand[][] = [];
|
||||||
const guildApplicationCommands: ApplicationCommand[][] = [];
|
|
||||||
|
|
||||||
for (const application of applications) {
|
for (const application of applications) {
|
||||||
globalApplicationCommands.push(await ApplicationCommand.find({ where: { application_id: application.id, guild_id: IsNull() } }));
|
applicationCommands.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: req.params.guild_id } }));
|
||||||
}
|
}
|
||||||
|
|
||||||
const applicationCommandsSendable = [];
|
const applicationCommandsSendable = [];
|
||||||
|
|
||||||
for (const command of [...globalApplicationCommands, ...guildApplicationCommands].flat()) {
|
for (const command of applicationCommands.flat()) {
|
||||||
applicationCommandsSendable.push({
|
applicationCommandsSendable.push({
|
||||||
application_id: command.application_id,
|
application_id: command.application_id,
|
||||||
description: command.description,
|
description: command.description,
|
||||||
|
|||||||
Reference in New Issue
Block a user