mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-14 16:13:08 +02:00
51 lines
1.5 KiB
JavaScript
51 lines
1.5 KiB
JavaScript
|
const { SlashCommand } = require('@eartharoid/dbf');
|
||
|
const { ApplicationCommandOptionType } = require('discord.js');
|
||
|
|
||
|
module.exports = class RemoveSlashCommand extends SlashCommand {
|
||
|
constructor(client, options) {
|
||
|
const descriptionLocalizations = {};
|
||
|
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.remove.description')));
|
||
|
|
||
|
const nameLocalizations = {};
|
||
|
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.remove.name')));
|
||
|
|
||
|
let opts = [
|
||
|
{
|
||
|
name: 'member',
|
||
|
required: true,
|
||
|
type: ApplicationCommandOptionType.User,
|
||
|
},
|
||
|
{
|
||
|
name: 'ticket',
|
||
|
required: false,
|
||
|
type: ApplicationCommandOptionType.Channel,
|
||
|
},
|
||
|
];
|
||
|
opts = opts.map(o => {
|
||
|
const descriptionLocalizations = {};
|
||
|
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.remove.options.${o.name}.description`)));
|
||
|
|
||
|
const nameLocalizations = {};
|
||
|
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.remove.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) { }
|
||
|
};
|