mirror of
https://github.com/bsedin/matrix-webhook.git
synced 2026-04-09 19:35:39 +00:00
Add support for using predefined access token
This commit is contained in:
@@ -44,7 +44,8 @@ async def join_room(room_id):
|
||||
if isinstance(resp, JoinError):
|
||||
if resp.status_code == "M_UNKNOWN_TOKEN":
|
||||
LOGGER.warning("Reconnecting")
|
||||
await CLIENT.login(conf.MATRIX_PW)
|
||||
if conf.MATRIX_PW:
|
||||
await CLIENT.login(conf.MATRIX_PW)
|
||||
else:
|
||||
return create_json_response(error_map(resp), resp.message)
|
||||
else:
|
||||
@@ -67,7 +68,8 @@ async def send_room_message(room_id, content):
|
||||
if isinstance(resp, RoomSendError):
|
||||
if resp.status_code == "M_UNKNOWN_TOKEN":
|
||||
LOGGER.warning("Reconnecting")
|
||||
await CLIENT.login(conf.MATRIX_PW)
|
||||
if conf.MATRIX_PW:
|
||||
await CLIENT.login(conf.MATRIX_PW)
|
||||
else:
|
||||
return create_json_response(error_map(resp), resp.message)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user