import { Command } from 'discord-akairo'; import { Message } from 'discord.js'; export default class ReloadOwner extends Command { public constructor() { super('reload', { aliases: ['reload', 'reboot', 'reloadlistener'], category: 'owner', description: { content: 'Reload a command.', usage: '[command]', examples: [ 'ping' ] }, ratelimit: 3, args: [ { id: 'command', type: 'string', prompt: { start: 'What command would you like to reload?', }, match: 'rest' } ], ownerOnly: true }); } public exec(msg: Message, { command }): Promise { if (msg.util.parsed.alias == 'reloadlistener') { this.client.listenerHandler.reload(command); return msg.channel.send(`Successfully reloaded the listener ${command}`); } else { this.handler.reload(command); return msg.channel.send(`Successfully reloaded the command ${command}`); } } }