From b4618aac1b9c2c58305606125bc8cf3cd557916f Mon Sep 17 00:00:00 2001 From: Isaac Date: Tue, 2 Aug 2022 21:13:32 +0100 Subject: [PATCH] Create commands --- README.md | 4 +- package.json | 2 +- src/autocomplete/references.js | 12 ++ src/autocomplete/ticket.js | 12 ++ src/commands/message/create.js | 17 +++ src/commands/message/pin.js | 17 +++ src/commands/slash/add.js | 51 +++++++++ src/commands/slash/close.js | 61 ++++++++++ src/commands/slash/force-close.js | 61 ++++++++++ src/commands/slash/new.js | 47 ++++++++ src/commands/slash/priority.js | 59 ++++++++++ src/commands/slash/remove.js | 51 +++++++++ src/commands/slash/tag.js | 47 ++++++++ src/commands/slash/tickets.js | 46 ++++++++ src/commands/slash/topic.js | 46 ++++++++ src/commands/slash/transcript.js | 47 ++++++++ src/commands/user/create.js | 17 +++ src/i18n/en-GB.yml | 144 +++++++++++++++++++++--- src/listeners/commands/componentLoad.js | 21 ++++ 19 files changed, 743 insertions(+), 19 deletions(-) create mode 100644 src/autocomplete/references.js create mode 100644 src/autocomplete/ticket.js create mode 100644 src/commands/message/create.js create mode 100644 src/commands/message/pin.js create mode 100644 src/commands/slash/add.js create mode 100644 src/commands/slash/close.js create mode 100644 src/commands/slash/force-close.js create mode 100644 src/commands/slash/new.js create mode 100644 src/commands/slash/priority.js create mode 100644 src/commands/slash/remove.js create mode 100644 src/commands/slash/tag.js create mode 100644 src/commands/slash/tickets.js create mode 100644 src/commands/slash/topic.js create mode 100644 src/commands/slash/transcript.js create mode 100644 src/commands/user/create.js create mode 100644 src/listeners/commands/componentLoad.js diff --git a/README.md b/README.md index 7f13b31..cc63107 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,6 @@ PORTAL=http://localhost:3000 SUPER= -https://www.prisma.io/docs/reference/database-reference/supported-databases \ No newline at end of file +https://www.prisma.io/docs/reference/database-reference/supported-databases + +![](https://static.eartharoid.me/k/22/08/02185801.png) - for user/create and slash/force-close \ No newline at end of file diff --git a/package.json b/package.json index 612aa58..b0e911b 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "node": ">=18.0" }, "dependencies": { - "@eartharoid/dbf": "^0.3.1", + "@eartharoid/dbf": "^0.3.2", "@eartharoid/dtf": "^2.0.1", "@eartharoid/i18n": "^1.0.4", "@fastify/cookie": "^6.0.0", diff --git a/src/autocomplete/references.js b/src/autocomplete/references.js new file mode 100644 index 0000000..5d3c128 --- /dev/null +++ b/src/autocomplete/references.js @@ -0,0 +1,12 @@ +const { Autocompleter } = require('@eartharoid/dbf'); + +module.exports = class ReferencesCompleter extends Autocompleter { + constructor(client, options) { + super(client, { + ...options, + id: 'references', + }); + } + + async run(value, comamnd, interaction) { } +}; \ No newline at end of file diff --git a/src/autocomplete/ticket.js b/src/autocomplete/ticket.js new file mode 100644 index 0000000..6c7214b --- /dev/null +++ b/src/autocomplete/ticket.js @@ -0,0 +1,12 @@ +const { Autocompleter } = require('@eartharoid/dbf'); + +module.exports = class TicketCompleter extends Autocompleter { + constructor(client, options) { + super(client, { + ...options, + id: 'ticket', + }); + } + + async run(value, comamnd, interaction) { } +}; \ No newline at end of file diff --git a/src/commands/message/create.js b/src/commands/message/create.js new file mode 100644 index 0000000..774e8fd --- /dev/null +++ b/src/commands/message/create.js @@ -0,0 +1,17 @@ +const { MessageCommand } = require('@eartharoid/dbf'); + +module.exports = class CreateMessageCommand extends MessageCommand { + constructor(client, options) { + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.message.create.name'))); + + super(client, { + ...options, + dmPermission: false, + name: nameLocalizations['en-GB'], + nameLocalizations, + }); + } + + async run(interaction) { } +}; \ No newline at end of file diff --git a/src/commands/message/pin.js b/src/commands/message/pin.js new file mode 100644 index 0000000..fbcfb05 --- /dev/null +++ b/src/commands/message/pin.js @@ -0,0 +1,17 @@ +const { MessageCommand } = require('@eartharoid/dbf'); + +module.exports = class PinMessageCommand extends MessageCommand { + constructor(client, options) { + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.message.pin.name'))); + + super(client, { + ...options, + dmPermission: false, + name: nameLocalizations['en-GB'], + nameLocalizations, + }); + } + + async run(interaction) { } +}; \ No newline at end of file diff --git a/src/commands/slash/add.js b/src/commands/slash/add.js new file mode 100644 index 0000000..c126a41 --- /dev/null +++ b/src/commands/slash/add.js @@ -0,0 +1,51 @@ +const { SlashCommand } = require('@eartharoid/dbf'); +const { ApplicationCommandOptionType } = require('discord.js'); + +module.exports = class AddSlashCommand extends SlashCommand { + constructor(client, options) { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.add.description'))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.add.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.add.options.${o.name}.description`))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.add.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) { } +}; \ No newline at end of file diff --git a/src/commands/slash/close.js b/src/commands/slash/close.js new file mode 100644 index 0000000..74bad52 --- /dev/null +++ b/src/commands/slash/close.js @@ -0,0 +1,61 @@ +const { SlashCommand } = require('@eartharoid/dbf'); +const { ApplicationCommandOptionType } = require('discord.js'); + +module.exports = class CloseSlashCommand extends SlashCommand { + constructor(client, options) { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.close.description'))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.close.name'))); + + let opts = [ + { + name: 'channel', + required: false, + type: ApplicationCommandOptionType.Channel, + }, + { + name: 'number', + required: false, + type: ApplicationCommandOptionType.Integer, + }, + { + name: 'reason', + required: false, + type: ApplicationCommandOptionType.String, + }, + { + name: 'time', + required: false, + type: ApplicationCommandOptionType.String, + }, + ]; + opts = opts.map(o => { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.close.options.${o.name}.description`))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.close.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) { } +}; \ No newline at end of file diff --git a/src/commands/slash/force-close.js b/src/commands/slash/force-close.js new file mode 100644 index 0000000..a122652 --- /dev/null +++ b/src/commands/slash/force-close.js @@ -0,0 +1,61 @@ +const { SlashCommand } = require('@eartharoid/dbf'); +const { ApplicationCommandOptionType } = require('discord.js'); + +module.exports = class ForceCloseSlashCommand extends SlashCommand { + constructor(client, options) { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.force-close.description'))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.force-close.name'))); + + let opts = [ + { + name: 'channel', + required: false, + type: ApplicationCommandOptionType.Channel, + }, + { + name: 'number', + required: false, + type: ApplicationCommandOptionType.Integer, + }, + { + name: 'reason', + required: false, + type: ApplicationCommandOptionType.String, + }, + { + name: 'time', + required: false, + type: ApplicationCommandOptionType.String, + }, + ]; + opts = opts.map(o => { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.force-close.options.${o.name}.description`))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.force-close.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) { } +}; \ No newline at end of file diff --git a/src/commands/slash/new.js b/src/commands/slash/new.js new file mode 100644 index 0000000..2fd5da2 --- /dev/null +++ b/src/commands/slash/new.js @@ -0,0 +1,47 @@ +const { SlashCommand } = require('@eartharoid/dbf'); +const { ApplicationCommandOptionType } = require('discord.js'); + +module.exports = class NewSlashCommand extends SlashCommand { + constructor(client, options) { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.new.description'))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.new.name'))); + + let opts = [ + { + autocomplete: true, + name: 'references', + required: false, + type: ApplicationCommandOptionType.Integer, + }, + ]; + opts = opts.map(o => { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.new.options.${o.name}.description`))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.new.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) { } +}; \ No newline at end of file diff --git a/src/commands/slash/priority.js b/src/commands/slash/priority.js new file mode 100644 index 0000000..d13aac9 --- /dev/null +++ b/src/commands/slash/priority.js @@ -0,0 +1,59 @@ +const { SlashCommand } = require('@eartharoid/dbf'); +const { ApplicationCommandOptionType } = require('discord.js'); + +module.exports = class PrioritySlashCommand extends SlashCommand { + constructor(client, options) { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.priority.description'))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.priority.name'))); + + let opts = [ + { + choices: ['HIGH', 'MEDIUM', 'LOW'], + name: 'priority', + required: true, + type: ApplicationCommandOptionType.String, + }, + ]; + opts = opts.map(o => { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.priority.options.${o.name}.description`))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.priority.options.${o.name}.name`))); + + if (o.choices) { + o.choices = o.choices.map(c => { + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.priority.options.${o.name}.choices.${c}`))); + return { + name: nameLocalizations['en-GB'], + nameLocalizations: nameLocalizations, + value: c, + }; + }); + } + + 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) { } +}; \ No newline at end of file diff --git a/src/commands/slash/remove.js b/src/commands/slash/remove.js new file mode 100644 index 0000000..aded8e2 --- /dev/null +++ b/src/commands/slash/remove.js @@ -0,0 +1,51 @@ +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) { } +}; \ No newline at end of file diff --git a/src/commands/slash/tag.js b/src/commands/slash/tag.js new file mode 100644 index 0000000..832be57 --- /dev/null +++ b/src/commands/slash/tag.js @@ -0,0 +1,47 @@ +const { SlashCommand } = require('@eartharoid/dbf'); +const { ApplicationCommandOptionType } = require('discord.js'); + +module.exports = class TagSlashCommand extends SlashCommand { + constructor(client, options) { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.tag.description'))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.tag.name'))); + + let opts = [ + { + autocomplete: true, + name: 'tag', + required: true, + type: ApplicationCommandOptionType.String, + }, + ]; + opts = opts.map(o => { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.tag.options.${o.name}.description`))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.tag.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) { } +}; \ No newline at end of file diff --git a/src/commands/slash/tickets.js b/src/commands/slash/tickets.js new file mode 100644 index 0000000..94a7cce --- /dev/null +++ b/src/commands/slash/tickets.js @@ -0,0 +1,46 @@ +const { SlashCommand } = require('@eartharoid/dbf'); +const { ApplicationCommandOptionType } = require('discord.js'); + +module.exports = class TicketsSlashCommand extends SlashCommand { + constructor(client, options) { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.tickets.description'))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.tickets.name'))); + + let opts = [ + { + name: 'member', + required: false, + type: ApplicationCommandOptionType.User, + }, + ]; + opts = opts.map(o => { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.tickets.options.${o.name}.description`))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.tickets.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) { } +}; \ No newline at end of file diff --git a/src/commands/slash/topic.js b/src/commands/slash/topic.js new file mode 100644 index 0000000..1774dc1 --- /dev/null +++ b/src/commands/slash/topic.js @@ -0,0 +1,46 @@ +const { SlashCommand } = require('@eartharoid/dbf'); +const { ApplicationCommandOptionType } = require('discord.js'); + +module.exports = class TopicSlashCommand extends SlashCommand { + constructor(client, options) { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.topic.description'))); + + 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'], + descriptionLocalizations, + dmPermission: false, + name: nameLocalizations['en-GB'], + nameLocalizations, + options: opts, + }); + } + + async run(interaction) { } +}; \ No newline at end of file diff --git a/src/commands/slash/transcript.js b/src/commands/slash/transcript.js new file mode 100644 index 0000000..db9ad4b --- /dev/null +++ b/src/commands/slash/transcript.js @@ -0,0 +1,47 @@ +const { SlashCommand } = require('@eartharoid/dbf'); +const { ApplicationCommandOptionType } = require('discord.js'); + +module.exports = class TranscriptSlashCommand extends SlashCommand { + constructor(client, options) { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.transcript.description'))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.slash.transcript.name'))); + + let opts = [ + { + autocomplete: true, + name: 'ticket', + required: true, + type: ApplicationCommandOptionType.Integer, + }, + ]; + opts = opts.map(o => { + const descriptionLocalizations = {}; + client.i18n.locales.forEach(l => (descriptionLocalizations[l] = client.i18n.getMessage(l, `commands.slash.transcript.options.${o.name}.description`))); + + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, `commands.slash.transcript.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) { } +}; \ No newline at end of file diff --git a/src/commands/user/create.js b/src/commands/user/create.js new file mode 100644 index 0000000..8a9579b --- /dev/null +++ b/src/commands/user/create.js @@ -0,0 +1,17 @@ +const { UserCommand } = require('@eartharoid/dbf'); + +module.exports = class CreateUserCommand extends UserCommand { + constructor(client, options) { + const nameLocalizations = {}; + client.i18n.locales.forEach(l => (nameLocalizations[l] = client.i18n.getMessage(l, 'commands.user.create.name'))); + + super(client, { + ...options, + dmPermission: false, + name: nameLocalizations['en-GB'], + nameLocalizations, + }); + } + + async run(interaction) { } +}; \ No newline at end of file diff --git a/src/i18n/en-GB.yml b/src/i18n/en-GB.yml index 9dedf91..b53b472 100644 --- a/src/i18n/en-GB.yml +++ b/src/i18n/en-GB.yml @@ -1,32 +1,142 @@ +test: | + line 1 + line 2 buttons: create: - emoji: '🎫' - text: 'Create a ticket' + emoji: 🎫 + text: Create a ticket commands: + message: + create: + name: Create a ticket from message + pin: + name: Pin message + slash: + add: + description: Add a member to a ticket + name: add + options: + member: + description: The member to add to the ticket + name: member + ticket: + description: The ticket to add the member to + name: ticket + close: + description: Close a ticket + name: close + options: + channel: + description: The ticket channel to close + name: channel + number: + description: The number of the ticket to close + name: number + reason: + description: The reason for closing the ticket(s) + name: reason + time: + description: Close all tickets that have been inactive for the specific time + name: time + force-close: + description: Forcibly close a ticket + name: force-close + options: + channel: + description: The ticket channel to close + name: channel + number: + description: The number of the ticket to close + name: number + reason: + description: The reason for closing the ticket(s) + name: reason + time: + description: Close all tickets that have been inactive for the specific time + name: time + new: + description: Create a new ticket + name: new + options: + references: + description: The number of a related ticket + name: references + priority: + description: Set the priority of a ticket + name: priority + options: + priority: + choices: + HIGH: 🔴 High + MEDIUM: 🟠 Medium + LOW: 🟢 Low + description: The priority of the ticket + name: priority + remove: + description: Remove a member from a ticket + name: remove + options: + member: + description: The member to remove from the ticket + name: member + ticket: + description: The ticket to remove the member from + name: ticket + tag: + description: Use a tag + name: tag + options: + tag: + description: The name of the tag to use + name: tag + topic: + description: Change the topic of a ticket + name: topic + options: + new-topic: + description: The new topic of the ticket + name: new-topic + tickets: + description: List your own or someone else's tickets + name: tickets + options: + member: + description: The member to list the tickets of + name: member + transcript: + description: Get the transcript of a ticket + name: transcript + options: + ticket: + description: The number of the ticket to get the transcript of + name: ticket + user: + create: + name: Create a ticket for user log: admin: - changes: 'Changes' + changes: Changes description: joined: '{user} {verb} {targetType}' target: - category: 'a category' - panel: 'a panel' - question: 'a question' - settings: 'the settings' - tag: 'a tag' + category: a category + panel: a panel + question: a question + settings: the settings + tag: a tag title: joined: '{targetType} {verb}' target: - category: 'Category' - panel: 'Panel' - question: 'Question' - settings: 'Settings' - tag: 'Tag' + category: Category + panel: Panel + question: Question + settings: Settings + tag: Tag verb: - create: 'created' - delete: 'deleted' - update: 'updated' + create: created + delete: deleted + update: updated tickets: menus: create: - placeholder: 'Select a ticket category' \ No newline at end of file + placeholder: Select a ticket category \ No newline at end of file diff --git a/src/listeners/commands/componentLoad.js b/src/listeners/commands/componentLoad.js new file mode 100644 index 0000000..019f604 --- /dev/null +++ b/src/listeners/commands/componentLoad.js @@ -0,0 +1,21 @@ +const { Listener } = require('@eartharoid/dbf'); + +module.exports = class extends Listener { + constructor(client, options) { + super(client, { + ...options, + emitter: client.commands, + event: 'componentLoad', + }); + } + + run(command) { + const types = { + 1: 'slash', + 2: 'user', + 3: 'message', + }; + this.client.log.info.commands(`Loaded "${command.name}" ${types[command.type]} command`); + return true; + } +};