From 2879cbd4a6a54076a04d71cfa605ae3b653c8da7 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Tue, 18 Feb 2020 19:47:58 +0100 Subject: [PATCH] Make it into only 1 command --- commands/owner/reload.js | 37 +++++++++++++++++++++++++++++++ commands/owner/reloadcmd.js | 30 ------------------------- commands/owner/reloadlisteners.js | 30 ------------------------- 3 files changed, 37 insertions(+), 60 deletions(-) create mode 100644 commands/owner/reload.js delete mode 100644 commands/owner/reloadcmd.js delete mode 100644 commands/owner/reloadlisteners.js diff --git a/commands/owner/reload.js b/commands/owner/reload.js new file mode 100644 index 00000000..4e729aba --- /dev/null +++ b/commands/owner/reload.js @@ -0,0 +1,37 @@ +const { Command } = require('discord-akairo'); + +class reloadcmdCommand extends Command { + constructor() { + super('reloadcmd', { + aliases: ['reloadcmd', 'reloadlistener', 'reload'], + category: 'owner', + ownerOnly: 'true', + args: [ + { + id: 'command', + type: 'string', + match: 'rest' + } + ], + description: { + content: 'reload command', + usage: '[command]', + examples: ['ping'] + } + }); + } + + async exec(message, args) { + if (message.util.parsed.alias == 'reloadlistener') { + this.client.listenerHandler.reload(args.command); + return message.channel.send(`successfully reloaded listener ${args.command}`); + } else { + this.handler.reload(args.command); + return message.channel.send(`successfully reloaded command ${args.command}`); + } + + + } +} + +module.exports = reloadcmdCommand; \ No newline at end of file diff --git a/commands/owner/reloadcmd.js b/commands/owner/reloadcmd.js deleted file mode 100644 index 7ab8dbfd..00000000 --- a/commands/owner/reloadcmd.js +++ /dev/null @@ -1,30 +0,0 @@ -const { Command } = require('discord-akairo'); - -class reloadcmdCommand extends Command { - constructor() { - super('reloadcmd', { - aliases: ['reloadcmd'], - category: 'owner', - ownerOnly: 'true', - args: [ - { - id: 'command', - type: 'string', - match: 'rest' - } - ], - description: { - content: 'reload command', - usage: '[command]', - examples: ['ping'] - } - }); - } - - async exec(message, args) { - this.handler.reload(args.command); - return message.channel.send(`successfully reloaded command ${args.command}`); - } -} - -module.exports = reloadcmdCommand; \ No newline at end of file diff --git a/commands/owner/reloadlisteners.js b/commands/owner/reloadlisteners.js deleted file mode 100644 index 8dcc5a71..00000000 --- a/commands/owner/reloadlisteners.js +++ /dev/null @@ -1,30 +0,0 @@ -const { Command } = require('discord-akairo'); - -class reloadlistenerCommand extends Command { - constructor() { - super('reloadlistener', { - aliases: ['reloadlistener'], - category: 'owner', - ownerOnly: 'true', - args: [ - { - id: 'listener', - type: 'string', - match: 'rest' - } - ], - description: { - content: 'reload command', - usage: '[command]', - examples: ['ping'] - } - }); - } - - async exec(message, args) { - this.client.listenerHandler.reload(args.listener); - return message.channel.send(`successfully reloaded listener ${args.listener}`); - } -} - -module.exports = reloadlistenerCommand; \ No newline at end of file