You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to edit a command module by adding another alias.
The first thing I did was go into the commandHandler object const h = this.client.commandHandler.modules.map(e => e); const cmd = h[9]; cmd['aliases'].push('alias2');
The new aliases does get pushed, but the handler doesn't seem to use it. So then, I tried reloading after and the result of that was very, very confusing.
Input -> const h = this.client.commandHandler.modules.map(e => e); const cmd = h[9]; cmd['aliases'].push('stats'); cmd.reload()
Output -> > dice
"dice" is a completely different command module, and it didn't work there afterwards either.
Since Akairo is as modular as it is, could you just make another listener for new aliases to be added?
The text was updated successfully, but these errors were encountered:
Reloading is not for in-memory changes, but for physical code changes. Adding a new alias like that will not work. The correct way to do it would be to do handler.aliases.set('alias', command).
Also, I recommend you to look at the register and deregister methods on CommandHandler. They may be of use, but this all seems like a very strange problem to have in the first place.
I tried to edit a command module by adding another alias.
The first thing I did was go into the commandHandler object
const h = this.client.commandHandler.modules.map(e => e); const cmd = h[9]; cmd['aliases'].push('alias2');
The new aliases does get pushed, but the handler doesn't seem to use it. So then, I tried reloading after and the result of that was very, very confusing.
Input ->
const h = this.client.commandHandler.modules.map(e => e); const cmd = h[9]; cmd['aliases'].push('stats'); cmd.reload()
Output ->
> dice
"dice" is a completely different command module, and it didn't work there afterwards either.
Since Akairo is as modular as it is, could you just make another listener for new aliases to be added?
The text was updated successfully, but these errors were encountered: