mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-05 04:13:08 +02:00
Add move
command
This commit is contained in:
parent
b4618aac1b
commit
954681685a
@ -11,4 +11,4 @@ SUPER=
|
||||
|
||||
https://www.prisma.io/docs/reference/database-reference/supported-databases
|
||||
|
||||
![](https://static.eartharoid.me/k/22/08/02185801.png) - for user/create and slash/force-close
|
||||
![](https://static.eartharoid.me/k/22/08/02185801.png) - for user/create, slash/force-close and slash/move
|
12
src/autocomplete/category.js
Normal file
12
src/autocomplete/category.js
Normal file
@ -0,0 +1,12 @@
|
||||
const { Autocompleter } = require('@eartharoid/dbf');
|
||||
|
||||
module.exports = class CategoryCompleter extends Autocompleter {
|
||||
constructor(client, options) {
|
||||
super(client, {
|
||||
...options,
|
||||
id: 'category',
|
||||
});
|
||||
}
|
||||
|
||||
async run(value, comamnd, interaction) { }
|
||||
};
|
47
src/commands/slash/move.js
Normal file
47
src/commands/slash/move.js
Normal file
@ -0,0 +1,47 @@
|
||||
const { SlashCommand } = require('@eartharoid/dbf');
|
||||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
|
||||
module.exports = class MoveSlashCommand extends SlashCommand {
|
||||
constructor(client, options) {
|
||||
const descriptionLocalizations = {};
|
||||
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.move.description')));
|
||||
|
||||
const nameLocalizations = {};
|
||||
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.move.name')));
|
||||
|
||||
let opts = [
|
||||
{
|
||||
autocomplete: true,
|
||||
name: 'category',
|
||||
required: true,
|
||||
type: ApplicationCommandOptionType.String,
|
||||
},
|
||||
];
|
||||
opts = opts.map(o => {
|
||||
const descriptionLocalizations = {};
|
||||
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.move.options.${o.name}.description`)));
|
||||
|
||||
const nameLocalizations = {};
|
||||
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.move.options.${o.name}.name`)));
|
||||
|
||||
return {
|
||||
...o,
|
||||
description: descriptionLocalizations['en-GB'],
|
||||
descriptionLocalizations,
|
||||
nameLocalizations: nameLocalizations,
|
||||
};
|
||||
});
|
||||
|
||||
super(client, {
|
||||
...options,
|
||||
description: descriptionLocalizations['en-GB'],
|
||||
descriptionLocalizations,
|
||||
dmPermission: false,
|
||||
name: nameLocalizations['en-GB'],
|
||||
nameLocalizations,
|
||||
options: opts,
|
||||
});
|
||||
}
|
||||
|
||||
async run(interaction) { }
|
||||
};
|
@ -54,6 +54,13 @@ commands:
|
||||
time:
|
||||
description: Close all tickets that have been inactive for the specific time
|
||||
name: time
|
||||
move:
|
||||
description: Move a ticket to another category
|
||||
name: move
|
||||
options:
|
||||
category:
|
||||
description: The category to move the ticket to
|
||||
name: category
|
||||
new:
|
||||
description: Create a new ticket
|
||||
name: new
|
||||
|
Loading…
Reference in New Issue
Block a user