forked from Supositware/Haha-Yes
Make it into only 1 command
This commit is contained in:
parent
bcc0c32386
commit
2879cbd4a6
2 changed files with 10 additions and 33 deletions
|
@ -3,7 +3,7 @@ const { Command } = require('discord-akairo');
|
||||||
class reloadcmdCommand extends Command {
|
class reloadcmdCommand extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('reloadcmd', {
|
super('reloadcmd', {
|
||||||
aliases: ['reloadcmd'],
|
aliases: ['reloadcmd', 'reloadlistener', 'reload'],
|
||||||
category: 'owner',
|
category: 'owner',
|
||||||
ownerOnly: 'true',
|
ownerOnly: 'true',
|
||||||
args: [
|
args: [
|
||||||
|
@ -22,8 +22,15 @@ class reloadcmdCommand extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
async exec(message, args) {
|
async exec(message, args) {
|
||||||
this.handler.reload(args.command);
|
if (message.util.parsed.alias == 'reloadlistener') {
|
||||||
return message.channel.send(`successfully reloaded command ${args.command}`);
|
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}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
|
Loading…
Reference in a new issue