From 2ca83c3146807bdfae601cef7e90223d46ebd826 Mon Sep 17 00:00:00 2001 From: Isaac Date: Sun, 16 May 2021 15:11:24 +0100 Subject: [PATCH] Add commands --- src/commands/add.js | 34 ++++++++++++++++++ src/commands/blacklist.js | 4 +-- src/commands/help.js | 31 ++++++++++++++++ src/commands/remove.js | 34 ++++++++++++++++++ src/commands/settings.js | 4 ++- src/commands/stats.js | 22 ++++++++++++ src/commands/topic.js | 28 +++++++++++++++ src/locales/en-GB.json | 74 ++++++++++++++++++++++++++++++++++++++- 8 files changed, 227 insertions(+), 4 deletions(-) create mode 100644 src/commands/add.js create mode 100644 src/commands/help.js create mode 100644 src/commands/remove.js create mode 100644 src/commands/stats.js create mode 100644 src/commands/topic.js diff --git a/src/commands/add.js b/src/commands/add.js new file mode 100644 index 0000000..d41e931 --- /dev/null +++ b/src/commands/add.js @@ -0,0 +1,34 @@ +const Command = require('../modules/commands/command'); +const { MessageEmbed } = require('discord.js'); + +module.exports = class AddCommand extends Command { + constructor(client) { + const i18n = client.i18n.getLocale(client.config.locale); + super(client, { + internal: true, + name: i18n('commands.add.name'), + description: i18n('commands.add.description'), + aliases: [], + process_args: false, + args: [ + { + name: i18n('commands.add.args.member.name'), + description: i18n('commands.add.args.member.description'), + example: i18n('commands.add.args.member.example'), + required: true, + }, + { + name: i18n('commands.add.args.ticket.name'), + description: i18n('commands.add.args.ticket.description'), + example: i18n('commands.add.args.ticket.example'), + required: false, + } + ] + }); + } + + async execute(message, args) { + let settings = await message.guild.settings; + const i18n = this.client.i18n.getLocale(settings.locale); + } +}; \ No newline at end of file diff --git a/src/commands/blacklist.js b/src/commands/blacklist.js index 82b5d4e..dbf4b68 100644 --- a/src/commands/blacklist.js +++ b/src/commands/blacklist.js @@ -11,7 +11,6 @@ module.exports = class BlacklistCommand extends Command { aliases: [ i18n('commands.blacklist.aliases.unblacklist'), ], - permissions: ['MANAGE_GUILD'], // staff_only: true, process_args: false, args: [ { @@ -20,7 +19,8 @@ module.exports = class BlacklistCommand extends Command { example: i18n('commands.blacklist.args.member_or_role.example'), required: false, } - ] + ], + permissions: ['MANAGE_GUILD'] }); } diff --git a/src/commands/help.js b/src/commands/help.js new file mode 100644 index 0000000..b6e7269 --- /dev/null +++ b/src/commands/help.js @@ -0,0 +1,31 @@ +const Command = require('../modules/commands/command'); +const { MessageEmbed } = require('discord.js'); + +module.exports = class HelpCommand extends Command { + constructor(client) { + const i18n = client.i18n.getLocale(client.config.locale); + super(client, { + internal: true, + name: i18n('commands.help.name'), + description: i18n('commands.help.description'), + aliases: [ + i18n('commands.help.aliases.command'), + i18n('commands.help.aliases.commands'), + ], + process_args: false, + args: [ + { + name: i18n('commands.help.args.command.name'), + description: i18n('commands.help.args.command.description'), + example: i18n('commands.help.args.command.example'), + required: false, + } + ] + }); + } + + async execute(message, args) { + let settings = await message.guild.settings; + const i18n = this.client.i18n.getLocale(settings.locale); + } +}; \ No newline at end of file diff --git a/src/commands/remove.js b/src/commands/remove.js new file mode 100644 index 0000000..d1e5572 --- /dev/null +++ b/src/commands/remove.js @@ -0,0 +1,34 @@ +const Command = require('../modules/commands/command'); +const { MessageEmbed } = require('discord.js'); + +module.exports = class RemoveCommand extends Command { + constructor(client) { + const i18n = client.i18n.getLocale(client.config.locale); + super(client, { + internal: true, + name: i18n('commands.remove.name'), + description: i18n('commands.remove.description'), + aliases: [], + process_args: false, + args: [ + { + name: i18n('commands.remove.args.member.name'), + description: i18n('commands.remove.args.member.description'), + example: i18n('commands.remove.args.member.example'), + required: true, + }, + { + name: i18n('commands.remove.args.ticket.name'), + description: i18n('commands.remove.args.ticket.description'), + example: i18n('commands.remove.args.ticket.example'), + required: false, + } + ] + }); + } + + async execute(message, args) { + let settings = await message.guild.settings; + const i18n = this.client.i18n.getLocale(settings.locale); + } +}; \ No newline at end of file diff --git a/src/commands/settings.js b/src/commands/settings.js index b9dfcef..a20a861 100644 --- a/src/commands/settings.js +++ b/src/commands/settings.js @@ -8,10 +8,12 @@ module.exports = class SettingsCommand extends Command { super(client, { internal: true, name: i18n('commands.settings.name'), + description: i18n('commands.settings.description'), aliases: [ i18n('commands.settings.aliases.config'), ], - description: i18n('commands.settings.description'), + process_args: false, + args: [], permissions: ['MANAGE_GUILD'] }); } diff --git a/src/commands/stats.js b/src/commands/stats.js new file mode 100644 index 0000000..a735280 --- /dev/null +++ b/src/commands/stats.js @@ -0,0 +1,22 @@ +const Command = require('../modules/commands/command'); +const { MessageEmbed } = require('discord.js'); + +module.exports = class StatsCommand extends Command { + constructor(client) { + const i18n = client.i18n.getLocale(client.config.locale); + super(client, { + internal: true, + name: i18n('commands.stats.name'), + description: i18n('commands.stats.description'), + aliases: [], + process_args: false, + args: [], + staff_only: true + }); + } + + async execute(message, args) { + let settings = await message.guild.settings; + const i18n = this.client.i18n.getLocale(settings.locale); + } +}; \ No newline at end of file diff --git a/src/commands/topic.js b/src/commands/topic.js new file mode 100644 index 0000000..69e5bef --- /dev/null +++ b/src/commands/topic.js @@ -0,0 +1,28 @@ +const Command = require('../modules/commands/command'); +const { MessageEmbed } = require('discord.js'); + +module.exports = class TopicCommand extends Command { + constructor(client) { + const i18n = client.i18n.getLocale(client.config.locale); + super(client, { + internal: true, + name: i18n('commands.topic.name'), + description: i18n('commands.topic.description'), + aliases: [], + process_args: false, + args: [ + { + name: i18n('commands.topic.args.new_topic.name'), + description: i18n('commands.topic.args.new_topic.description'), + example: i18n('commands.topic.args.new_topic.example'), + required: true, + } + ] + }); + } + + async execute(message, args) { + let settings = await message.guild.settings; + const i18n = this.client.i18n.getLocale(settings.locale); + } +}; \ No newline at end of file diff --git a/src/locales/en-GB.json b/src/locales/en-GB.json index b21fc73..6f4927d 100644 --- a/src/locales/en-GB.json +++ b/src/locales/en-GB.json @@ -21,13 +21,31 @@ }, "collector_expires_in": "Expires in %d seconds", "commands": { + "add": { + "aliases": {}, + "args": { + "member": { + "description": "The member to add to the ticket", + "example": "@someone", + "name": "member" + }, + "ticket": { + "description": "The ticket to add the member to", + "example": "217", + "name": "ticket" + } + }, + "description": "Add a member to a ticket", + "name": "add", + "response": {} + }, "blacklist": { "aliases": { "unblacklist": "unblacklist" }, "args": { "member_or_role": { - "description": "A member mention, a role mention, or the ID of a member or role", + "description": "The member or role to add/remove", "example": "@NaughtyMember", "name": "memberOrRole" } @@ -140,6 +158,22 @@ } } }, + "help": { + "aliases": { + "command": "command", + "commands": "commands" + }, + "args": { + "member": { + "description": "The command to display information about", + "example": "new", + "name": "command" + } + }, + "description": "List commands you have access to, or find out more about a command", + "name": "help", + "response": {} + }, "new": { "aliases": { "create": "create", @@ -236,6 +270,24 @@ } } }, + "remove": { + "aliases": {}, + "args": { + "member": { + "description": "The member to remove from the ticket", + "example": "@someone", + "name": "member" + }, + "ticket": { + "description": "The ticket to remove the member from", + "example": "217", + "name": "ticket" + } + }, + "description": "Remove a member from a ticket", + "name": "remove", + "response": {} + }, "settings": { "aliases": { "config": "config" @@ -245,6 +297,26 @@ "response": { "updated": "✅ Settings have been updated." } + }, + "stats": { + "aliases": {}, + "args": {}, + "description": "Display ticket statistics", + "name": "stats", + "response": {} + }, + "topic": { + "aliases": {}, + "args": { + "new_topic": { + "description": "The new topic of the ticket", + "example": "billing issue", + "name": "new_topic" + } + }, + "description": "Change the topic of the ticket", + "name": "topic", + "response": {} } }, "command_execution_error": {