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 see a lot of other python frameworks use decorators to define commands, routes, etc. I think it would be a good extension to include that in our framework as well, and may simplify some of the boilerplate for module developers.
Here, the pair ("test", self.test_) would be automatically added to the module's self.commands dict, without needing to declare it in self.init() first.
Ideally, this should work with chaining other decorators, like hasPermission and AsArgs, as the command dec should not touch the parameters at all.
The text was updated successfully, but these errors were encountered:
Note: this is tricky. Just attempted to implement this, and of course decorators are evaluated at "parse-time". We'd need to make sure these don't add themselves to a class-wide commands dict. Module instances should be able to have their own commands dict.
I see a lot of other python frameworks use decorators to define commands, routes, etc. I think it would be a good extension to include that in our framework as well, and may simplify some of the boilerplate for module developers.
Something like the following would be nice:
Here, the pair ("test", self.test_) would be automatically added to the module's
self.commands
dict, without needing to declare it inself.init()
first.Ideally, this should work with chaining other decorators, like
hasPermission
andAsArgs
, as thecommand
dec should not touch the parameters at all.The text was updated successfully, but these errors were encountered: