Fixx.
This commit is contained in:
parent
11d47c3ebe
commit
9d93dadae0
@ -34,15 +34,18 @@ class Bot:
|
|||||||
self.joined = set()
|
self.joined = set()
|
||||||
|
|
||||||
async def run(self, reconnect=True):
|
async def run(self, reconnect=True):
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
await self.run_once()
|
await self.run_once()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print(ex)
|
print(ex)
|
||||||
await asyncio.sleep(1)
|
|
||||||
if not reconnect:
|
if not reconnect:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
await asyncio.sleep(1)
|
||||||
|
|
||||||
def has_joined(self, channel_uid):
|
def has_joined(self, channel_uid):
|
||||||
return channel_uid in self.joined
|
return channel_uid in self.joined
|
||||||
|
|
||||||
@ -72,6 +75,9 @@ class Bot:
|
|||||||
|
|
||||||
data = await rpc.receive()
|
data = await rpc.receive()
|
||||||
|
|
||||||
|
if data is None:
|
||||||
|
break
|
||||||
|
|
||||||
try:
|
try:
|
||||||
message = data.message.strip()
|
message = data.message.strip()
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
@ -98,5 +104,5 @@ class Bot:
|
|||||||
except AttributeError as ex:
|
except AttributeError as ex:
|
||||||
logger.exception(ex)
|
logger.exception(ex)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logger.exception(ex)
|
raise ex
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user