-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Legal way to get raw events #483
Comments
Hi @zba, For "raw" access you may want to look into python-mattermost-autodriver which is how mmpy_bot interacts with mattermost. If you want to implement conversational behavior in mmpy_bot, see also #140. |
The problem is how mmpy bot handles events, i access driver correct,. Please read example i provide. The problem, that autodriver init single time, it is not subscription by itself, so mmpy loose connection to driver if i init it in plugin, so i had to make this dirty trick to pass events back to mmpy. But if another plugin do same, 1st one will not receive events in my example. It could be easy fixed by making event proxy in eventhandler class, I not real pythonist, but you can use EventEmitter template (just found a lot libraries around so can't suggest any) |
See #445 for another request to add support for Reactions would need a new approach given The point of Contributions are welcome. |
Yes, i like i haven't too, but why not allow me also raw access as i have access to driver too ? The whole point of this issue is ask to add ability to use functions of driver not implemented in decorators. |
There may be a misunderstanding here. We aren't restricting anything in mmpy_bot. The driver used by this project and linked above is the core that handles the requests. It supports having one event handler function. This role is taken by the event handler in mmpy_bot. This handler is not accessible to plugins as this was not part of mmpy_bot's design. If you need access to it, you have two options:
If you choose 1, you are welcome to open a pull request with your contributions. Maintainers will review and decide upon it. |
Ah I got, i not need mmpy bot, because all it does is decorators on posts events, and i can just go with event model without decorators, hm, ok. I chose 2 |
Describe the bug
I don't find any way to make it correct to handle events for plugins
How To Reproduce
In short I wanted to make llm bot sample with mattermost and wanted to make a feature to regen on recycle reaction, so I tried to find how to get driver's events and not found any good way
Expected behavior
A Plugin has a function to call like
self.subscribe('event_name', callback)
(which implement for in subscribers call callback somewhere heremmpy_bot/mmpy_bot/event_handler.py
Line 58 in 3eb4f34
Operating Environment (please complete the following information):
Additional context
I solved it using this ugly way, but I think it is very bad,
The text was updated successfully, but these errors were encountered: