Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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"))