For outgoing messages, raise error if disconnected

This commit is contained in:
Andrew Ferrazzutti 2022-04-10 02:42:15 -04:00
parent 7b96687dae
commit 109e9bcc67
1 changed files with 2 additions and 2 deletions

View File

@ -773,8 +773,8 @@ class Portal(DBPortal, BasePortal):
sender, is_relay = await self.get_relay_sender(orig_sender, f"message {event_id}")
if not sender:
raise Exception("not logged in")
elif not sender.has_state:
raise Exception("not connected to KakaoTalk")
elif not sender.is_connected:
raise Exception("not connected to KakaoTalk chats")
elif is_relay:
await self.apply_relay_message_format(orig_sender, message)
if message.msgtype == MessageType.TEXT or message.msgtype == MessageType.NOTICE: