python-mattermost-driver icon indicating copy to clipboard operation
python-mattermost-driver copied to clipboard

JSON decode websocket events & allow usage of own loop

Open jorants opened this issue 3 years ago • 0 comments

This pull request adds two small changes to the websocket interface:

  1. 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?
  2. The websocket asyncio loop can now be specified for init_websocket. There is also a new run_websocket async 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.

jorants avatar Jan 19 '23 13:01 jorants