python-mattermost-driver
python-mattermost-driver copied to clipboard
JSON decode websocket events & allow usage of own loop
This pull request adds two small changes to the websocket interface:
- Events are decoded before being send, and only events are send to the eventhandler, not other messages. It might be needed to further decode this message in case of a 'posted' event. See https://github.com/mattermost/mattermost-server/issues/22110 Do we want to add that?
- The websocket asyncio loop can now be specified for
init_websocket. There is also a newrun_websocketasync function that can be used in case you need to run other tasks in the loop as well. For example, I needed my bot to check a RSS feed for updated, but also wanted to listen to the websocket.