From c6abefe30d3c493c7ba89bebb9180ef13473f0d1 Mon Sep 17 00:00:00 2001 From: Isaac Date: Wed, 10 Aug 2022 19:50:19 +0100 Subject: [PATCH] Rename `move` command to `transfer` --- src/commands/slash/{move.js => trasnfer.js} | 15 +++++++++------ src/i18n/en-GB.yml | 14 +++++++------- 2 files changed, 16 insertions(+), 13 deletions(-) rename src/commands/slash/{move.js => trasnfer.js} (67%) diff --git a/src/commands/slash/move.js b/src/commands/slash/trasnfer.js similarity index 67% rename from src/commands/slash/move.js rename to src/commands/slash/trasnfer.js index 6867570..71a8712 100644 --- a/src/commands/slash/move.js +++ b/src/commands/slash/trasnfer.js @@ -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) + } }; \ No newline at end of file diff --git a/src/i18n/en-GB.yml b/src/i18n/en-GB.yml index 0e376ba..966afd3 100644 --- a/src/i18n/en-GB.yml +++ b/src/i18n/en-GB.yml @@ -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