mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-07 18:41:26 +03:00
Add new /transfer
(ownership) command
This commit is contained in:
46
src/commands/slash/transfer.js
Normal file
46
src/commands/slash/transfer.js
Normal file
@@ -0,0 +1,46 @@
|
||||
const { SlashCommand } = require('@eartharoid/dbf');
|
||||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
|
||||
module.exports = class TransferSlashCommand extends SlashCommand {
|
||||
constructor(client, options) {
|
||||
const descriptionLocalizations = {};
|
||||
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.transfer.name')));
|
||||
|
||||
let opts = [
|
||||
{
|
||||
name: 'member',
|
||||
required: true,
|
||||
type: ApplicationCommandOptionType.User,
|
||||
},
|
||||
];
|
||||
opts = opts.map(o => {
|
||||
const descriptionLocalizations = {};
|
||||
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.transfer.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) {}
|
||||
};
|
Reference in New Issue
Block a user