Aliases not implemented in command execution
TheRetr0Doc opened this issue · 4 comments
Describe the bug
https://github.com/The-SourceCode/Open-SourceBot/blob/63d2ca63e403fa496582f6f37a2bb3ee4f6ef46b/src/handler/Handler.js#L183
https://github.com/The-SourceCode/Open-SourceBot/blob/63d2ca63e403fa496582f6f37a2bb3ee4f6ef46b/src/handler/Handler.js#L195
When running command, any specified to it aliases will not work in any way.
To Reproduce
Steps to reproduce the behavior:
- Command !help has aliase !h
- By executing !h you will see that nothing happens.
Expected behavior
It should execute same code that !help does
Additional context
Add any other context about the problem here.
I think it's because its missing the aliases part here:
https://github.com/The-SourceCode/Open-SourceBot/blob/63d2ca63e403fa496582f6f37a2bb3ee4f6ef46b/src/handler/Handler.js#L183
Something like this is what it's supposed to be afaik.
const cmd = this.commands.get(command.toLowerCase()) || this.aliases.get(command.toLowerCase());
Also, I have not seen anywhere in commands usage for isEnabled
part in code.
https://github.com/The-SourceCode/Open-SourceBot/blob/63d2ca63e403fa496582f6f37a2bb3ee4f6ef46b/src/handler/Handler.js#L184
@TheRetr0Doc The isEnabled
part of the code is used to enable modularity, so people can enable and disable some modules/commands/events.
For where it is, the Command class extends Toggleable which contains the isEnable variable.
Fixed by #36