woojiahao / Taiga

Discord administration bot
https://woojiahao.github.io/Taiga
MIT License
20 stars 12 forks source link

Potential Bug With setGlobal() #17

Closed woojiahao closed 5 years ago

woojiahao commented 5 years ago

There's a potential bug for the global flag as it gets overwritten by the CommandContainer.

Simulation

  1. Set a category to global
  2. Set a specific command in that category to not be global
  3. Run the bot and view the permissions
  4. Permission even for that specific command will be global
woojiahao commented 5 years ago

setGlobal should also be converted to an annotation for functions

woojiahao commented 5 years ago

Problem has been replicated, working on a fix now

woojiahao commented 5 years ago

Fix has been added. Now the global state on a command is nullable so if it remains null, it will inherit from its parent, otherwise, it will use it's own value of global. Opening a separate issue for the annotation idea