mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-05 17:51:27 +03:00
feat: finish /force-close
command (closes #311)
This commit is contained in:
@@ -18,8 +18,12 @@ module.exports = class CategoryCompleter extends Autocompleter {
|
||||
const client = this.client;
|
||||
|
||||
let categories = await client.prisma.category.findMany({ where: { guildId: interaction.guild.id } });
|
||||
const ticket = await client.prisma.ticket.findUnique({ where: { id: interaction.channel.id } });
|
||||
if (ticket) categories = categories.filter(category => ticket.categoryId !== category.id);
|
||||
|
||||
if (command.name === 'move') {
|
||||
const ticket = await client.prisma.ticket.findUnique({ where: { id: interaction.channel.id } });
|
||||
if (ticket) categories = categories.filter(category => ticket.categoryId !== category.id);
|
||||
}
|
||||
|
||||
const options = value ? categories.filter(category => category.name.match(new RegExp(value, 'i'))) : categories;
|
||||
await interaction.respond(
|
||||
options
|
||||
@@ -30,4 +34,4 @@ module.exports = class CategoryCompleter extends Autocompleter {
|
||||
})),
|
||||
);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user