How to use the mattermostdriver.Websocket function in mattermostdriver

To help you get started, we’ve selected a few mattermostdriver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opsdroid / opsdroid / opsdroid / connector / mattermost / __init__.py View on Github external
async def connect(self):
        """Connect to the chat service."""
        _LOGGER.info(_("Connecting to Mattermost"))

        login_response = self.mm_driver.login()

        _LOGGER.info(login_response)

        if "id" in login_response:
            self.bot_id = login_response["id"]
        if "username" in login_response:
            self.bot_name = login_response["username"]

        _LOGGER.info(_("Connected as %s"), self.bot_name)

        self.mm_driver.websocket = Websocket(
            self.mm_driver.options, self.mm_driver.client.token
        )

        _LOGGER.info(_("Connected successfully"))