From e66a772394a238e98e663456ada2a6433f2d2347 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 31 May 2019 16:57:08 +0200 Subject: [PATCH] load command --- commands/owner/load.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 commands/owner/load.js diff --git a/commands/owner/load.js b/commands/owner/load.js new file mode 100644 index 0000000..2c56db2 --- /dev/null +++ b/commands/owner/load.js @@ -0,0 +1,33 @@ +const { Command } = require('discord-akairo'); + +class loadCommand extends Command { + constructor() { + super('load', { + aliases: ['load'], + category: 'owner', + ownerOnly: 'true', + args: [ + { + id: 'command', + type: 'string', + match: 'rest' + } + ], + description: { + content: 'load command', + usage: '[command]', + examples: ['utility/ping.js'] + } + }); + } + + async exec(message, args) { + if (this.handler.load(`${__dirname}/../${args.command}`)) { + return message.channel.send(`Sucessfully loaded command ${args.command}`); + } else { + return message.channel.send(`Failed to load ${args.command}, did you point to the correct directory?`); + } + } +} + +module.exports = loadCommand; \ No newline at end of file