mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-13 23:53:08 +02:00
51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
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.Integer,
|
|
},
|
|
];
|
|
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) {
|
|
// TODO: check discordCategory max but not category max (ignore)
|
|
// TODO: update cached count for both categories and category-members (from and to)
|
|
}
|
|
};
|