mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 08:13:09 +02:00
Update ticket
autocompleter
This commit is contained in:
parent
3697423fda
commit
956648c265
@ -11,10 +11,10 @@ module.exports = class TicketCompleter extends Autocompleter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} value
|
* @param {string} value
|
||||||
* @param {*} comamnd
|
* @param {*} command
|
||||||
* @param {import("discord.js").AutocompleteInteraction} interaction
|
* @param {import("discord.js").AutocompleteInteraction} interaction
|
||||||
*/
|
*/
|
||||||
async run(value, comamnd, interaction) {
|
async run(value, command, interaction) {
|
||||||
/** @type {import("client")} */
|
/** @type {import("client")} */
|
||||||
const client = this.client;
|
const client = this.client;
|
||||||
const settings = await client.prisma.guild.findUnique({ where: { id: interaction.guild.id } });
|
const settings = await client.prisma.guild.findUnique({ where: { id: interaction.guild.id } });
|
||||||
@ -30,7 +30,7 @@ module.exports = class TicketCompleter extends Autocompleter {
|
|||||||
where: {
|
where: {
|
||||||
createdById: interaction.user.id,
|
createdById: interaction.user.id,
|
||||||
guildId: interaction.guild.id,
|
guildId: interaction.guild.id,
|
||||||
open: false,
|
open: ['add', 'close', 'force-close', 'remove'].includes(command.name), // false for `new`, `transcript` etc
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const options = value ? tickets.filter(t =>
|
const options = value ? tickets.filter(t =>
|
||||||
|
@ -16,9 +16,10 @@ module.exports = class AddSlashCommand extends SlashCommand {
|
|||||||
type: ApplicationCommandOptionType.User,
|
type: ApplicationCommandOptionType.User,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
autocomplete: true,
|
||||||
name: 'ticket',
|
name: 'ticket',
|
||||||
required: false,
|
required: false,
|
||||||
type: ApplicationCommandOptionType.Channel,
|
type: ApplicationCommandOptionType.Integer,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
opts = opts.map(o => {
|
opts = opts.map(o => {
|
||||||
|
@ -19,7 +19,7 @@ module.exports = class CloseSlashCommand extends SlashCommand {
|
|||||||
autocomplete: true,
|
autocomplete: true,
|
||||||
name: 'ticket',
|
name: 'ticket',
|
||||||
required: false,
|
required: false,
|
||||||
type: ApplicationCommandOptionType.String,
|
type: ApplicationCommandOptionType.Integer,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'time',
|
name: 'time',
|
||||||
|
@ -16,9 +16,10 @@ module.exports = class RemoveSlashCommand extends SlashCommand {
|
|||||||
type: ApplicationCommandOptionType.User,
|
type: ApplicationCommandOptionType.User,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
autocomplete: true,
|
||||||
name: 'ticket',
|
name: 'ticket',
|
||||||
required: false,
|
required: false,
|
||||||
type: ApplicationCommandOptionType.Channel,
|
type: ApplicationCommandOptionType.Integer,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
opts = opts.map(o => {
|
opts = opts.map(o => {
|
||||||
|
Loading…
Reference in New Issue
Block a user