2022-08-02 23:29:44 +03:00
|
|
|
const { SlashCommand } = require('@eartharoid/dbf');
|
|
|
|
const { ApplicationCommandOptionType } = require('discord.js');
|
|
|
|
|
2022-10-16 16:07:10 +03:00
|
|
|
module.exports = class MoveSlashCommand extends SlashCommand {
|
2022-08-02 23:29:44 +03:00
|
|
|
constructor(client, options) {
|
|
|
|
const descriptionLocalizations = {};
|
2022-10-16 16:07:10 +03:00
|
|
|
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.move.description')));
|
2022-08-02 23:29:44 +03:00
|
|
|
|
|
|
|
const nameLocalizations = {};
|
2022-10-16 16:07:10 +03:00
|
|
|
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.move.name')));
|
2022-08-02 23:29:44 +03:00
|
|
|
|
|
|
|
let opts = [
|
|
|
|
{
|
|
|
|
autocomplete: true,
|
|
|
|
name: 'category',
|
|
|
|
required: true,
|
2022-10-11 23:24:09 +03:00
|
|
|
type: ApplicationCommandOptionType.Integer,
|
2022-08-02 23:29:44 +03:00
|
|
|
},
|
|
|
|
];
|
|
|
|
opts = opts.map(o => {
|
|
|
|
const descriptionLocalizations = {};
|
2022-10-16 16:07:10 +03:00
|
|
|
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.move.options.${o.name}.description`)));
|
2022-08-02 23:29:44 +03:00
|
|
|
|
|
|
|
const nameLocalizations = {};
|
2022-10-16 16:07:10 +03:00
|
|
|
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.move.options.${o.name}.name`)));
|
2022-08-02 23:29:44 +03:00
|
|
|
|
|
|
|
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,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-08-10 21:50:19 +03:00
|
|
|
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)
|
|
|
|
}
|
2022-10-10 23:44:07 +03:00
|
|
|
};
|