SebastiaanYN/Open-SourceBot

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:

  1. Command !help has aliase !h
  2. By executing !h you will see that nothing happens.

Expected behavior
It should execute same code that !help does

Screenshots
image

Additional context
Add any other context about the problem here.

Jacxk commented

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());

@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