Upgrade.
This commit is contained in:
parent
9d93dadae0
commit
7c688c1c9b
@ -36,15 +36,17 @@ class Bot:
|
||||
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
|
||||
@ -103,6 +105,7 @@ class Bot:
|
||||
await self.on_message(data.username, data.user_nick, data.channel_uid, data.message)
|
||||
except AttributeError as ex:
|
||||
logger.exception(ex)
|
||||
raise
|
||||
except Exception as ex:
|
||||
raise ex
|
||||
|
||||
|
@ -61,10 +61,7 @@ class RPC:
|
||||
async def method(*args, **kwargs):
|
||||
self.current_call_id = str(uuid.uuid4())
|
||||
payload = dict(method=name, args=args, kwargs=kwargs, callId=self.current_call_id)
|
||||
try:
|
||||
await self.ws.send_json(payload)
|
||||
except Exception as ex:
|
||||
logger.exception(ex)
|
||||
await self.ws.send_json(payload)
|
||||
|
||||
async def returner():
|
||||
while True:
|
||||
|
Loading…
Reference in New Issue
Block a user