Dynamic handler management and registration context argument#9
Dynamic handler management and registration context argument#9seckrv wants to merge 3 commits intoshawnanastasio:masterfrom
Conversation
Dynamic handler management: The bot API is now able to dynamically remove registered handlers _without_ restarting. This allows e.g. the registration/deletion of new bot features/handlers through a matrix bot command. Additional Handler Argument: All handlers now have an extra (3rd) argument besides (room, event). This allows to pass information to the handler while registering. A possible use case is a handler, which reacts in the same way on different keywords, but needs to know about the context it was registered in.
|
Thanks for the PR. Looks like a useful addition. My main issue is that it seems to break backwards compatibility with older bots that expect only 2 parameters in their handler functions. A way to preserve backwards compatibility without over-complicating the library would be nice. Perhaps if the kwarg Also, could you explain your reasoning for adding the Finally (nitpick), I think the example Thanks, |
|
Sounds good |
|
Sorry for the late reply. I was kind of busy the last weeks. Regarding your questions: The The Maybe my idea is now clearer. Thanks for your comments. Cheers, |
Please refer to the commit messages for a more detailed description.