Haha-Yes/commands/owner/reload.js

37 lines
823 B
JavaScript
Raw Normal View History

2019-05-31 16:26:06 +02:00
const { Command } = require('discord-akairo');
2019-12-31 12:18:58 +01:00
class reloadcmdCommand extends Command {
2019-05-31 16:26:06 +02:00
constructor() {
2019-12-31 12:18:58 +01:00
super('reloadcmd', {
2020-02-18 19:47:58 +01:00
aliases: ['reloadcmd', 'reloadlistener', 'reload'],
2019-05-31 16:26:06 +02:00
category: 'owner',
ownerOnly: 'true',
args: [
{
id: 'command',
type: 'string',
match: 'rest'
}
],
description: {
content: 'reload command',
usage: '[command]',
examples: ['ping']
}
});
}
async exec(message, args) {
2020-02-18 19:47:58 +01:00
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}`);
}
2019-05-31 16:26:06 +02:00
}
}
2019-12-31 12:18:58 +01:00
module.exports = reloadcmdCommand;