Rename move command to transfer

This commit is contained in:
Isaac 2022-08-10 19:50:19 +01:00
parent 0bc02e808a
commit c6abefe30d
No known key found for this signature in database
GPG Key ID: F4EAABEB0FFCC06A
2 changed files with 16 additions and 13 deletions

View File

@ -1,13 +1,13 @@
const { SlashCommand } = require('@eartharoid/dbf');
const { ApplicationCommandOptionType } = require('discord.js');
module.exports = class MoveSlashCommand extends SlashCommand {
module.exports = class TransferSlashCommand extends SlashCommand {
constructor(client, options) {
const descriptionLocalizations = {};
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.move.description')));
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.transfer.description')));
const nameLocalizations = {};
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.move.name')));
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.transfer.name')));
let opts = [
{
@ -19,10 +19,10 @@ module.exports = class MoveSlashCommand extends SlashCommand {
];
opts = opts.map(o => {
const descriptionLocalizations = {};
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.move.options.${o.name}.description`)));
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.transfer.options.${o.name}.description`)));
const nameLocalizations = {};
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.move.options.${o.name}.name`)));
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.transfer.options.${o.name}.name`)));
return {
...o,
@ -43,5 +43,8 @@ module.exports = class MoveSlashCommand extends SlashCommand {
});
}
async run(interaction) { }
async run(interaction) {
// TODO: check discordCategory max but not category max (ignore)
// TODO: update cached count for both categories and category-members (from and to)
}
};

View File

@ -69,13 +69,6 @@ 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
@ -131,6 +124,13 @@ commands:
ticket:
description: The number of the ticket to get the transcript of
name: ticket
transfer:
description: Transfer a ticket to another category
name: transfer
options:
category:
description: The category to transfer the ticket to
name: category
user:
create:
name: Create a ticket for user