From bedd2345a44e6bb1b2e09423c588980c518e2965 Mon Sep 17 00:00:00 2001 From: retoor Date: Tue, 18 Feb 2025 15:34:57 +0000 Subject: [PATCH] fix: correct typo in commit message from 'Fixx' to 'Fix' for consistency --- src/snekbot/bot.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/snekbot/bot.py b/src/snekbot/bot.py index e26e1e8..4f04b7e 100644 --- a/src/snekbot/bot.py +++ b/src/snekbot/bot.py @@ -34,15 +34,18 @@ class Bot: self.joined = set() async def run(self, reconnect=True): + while True: try: await self.run_once() except Exception as ex: print(ex) - await asyncio.sleep(1) + if not reconnect: break + await asyncio.sleep(1) + def has_joined(self, channel_uid): return channel_uid in self.joined @@ -71,6 +74,9 @@ class Bot: pass data = await rpc.receive() + + if data is None: + break try: message = data.message.strip() @@ -98,5 +104,5 @@ class Bot: except AttributeError as ex: logger.exception(ex) except Exception as ex: - logger.exception(ex) + raise ex