mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-06 18:21:25 +03:00
ticket creation works
This commit is contained in:
23
src/commands/slash/claim.js
Normal file
23
src/commands/slash/claim.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const { SlashCommand } = require('@eartharoid/dbf');
|
||||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
|
||||
module.exports = class ClaimSlashCommand extends SlashCommand {
|
||||
constructor(client, options) {
|
||||
const descriptionLocalizations = {};
|
||||
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.claim.description')));
|
||||
|
||||
const nameLocalizations = {};
|
||||
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.claim.name')));
|
||||
|
||||
super(client, {
|
||||
...options,
|
||||
description: descriptionLocalizations['en-GB'],
|
||||
descriptionLocalizations,
|
||||
dmPermission: false,
|
||||
name: nameLocalizations['en-GB'],
|
||||
nameLocalizations,
|
||||
});
|
||||
}
|
||||
|
||||
async run(interaction) { }
|
||||
};
|
23
src/commands/slash/release.js
Normal file
23
src/commands/slash/release.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const { SlashCommand } = require('@eartharoid/dbf');
|
||||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
|
||||
module.exports = class ReleaseSlashCommand extends SlashCommand {
|
||||
constructor(client, options) {
|
||||
const descriptionLocalizations = {};
|
||||
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.release.description')));
|
||||
|
||||
const nameLocalizations = {};
|
||||
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.release.name')));
|
||||
|
||||
super(client, {
|
||||
...options,
|
||||
description: descriptionLocalizations['en-GB'],
|
||||
descriptionLocalizations,
|
||||
dmPermission: false,
|
||||
name: nameLocalizations['en-GB'],
|
||||
nameLocalizations,
|
||||
});
|
||||
}
|
||||
|
||||
async run(interaction) { }
|
||||
};
|
@@ -9,28 +9,6 @@ module.exports = class TopicSlashCommand extends SlashCommand {
|
||||
const nameLocalizations = {};
|
||||
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.topic.name')));
|
||||
|
||||
let opts = [
|
||||
{
|
||||
name: 'new-topic',
|
||||
required: true,
|
||||
type: ApplicationCommandOptionType.String,
|
||||
},
|
||||
];
|
||||
opts = opts.map(o => {
|
||||
const descriptionLocalizations = {};
|
||||
client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.topic.options.${o.name}.description`)));
|
||||
|
||||
const nameLocalizations = {};
|
||||
client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.topic.options.${o.name}.name`)));
|
||||
|
||||
return {
|
||||
...o,
|
||||
description: descriptionLocalizations['en-GB'],
|
||||
descriptionLocalizations,
|
||||
nameLocalizations: nameLocalizations,
|
||||
};
|
||||
});
|
||||
|
||||
super(client, {
|
||||
...options,
|
||||
description: descriptionLocalizations['en-GB'],
|
||||
@@ -38,7 +16,6 @@ module.exports = class TopicSlashCommand extends SlashCommand {
|
||||
dmPermission: false,
|
||||
name: nameLocalizations['en-GB'],
|
||||
nameLocalizations,
|
||||
options: opts,
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user