💡 update source docstring #46 #49

This commit is contained in:
yanyongyu
2020-11-13 01:46:26 +08:00
parent 5c29abd724
commit 28e3177e60
10 changed files with 160 additions and 77 deletions

View File

@ -150,7 +150,7 @@ class Driver(BaseDriver):
detail=e.reason) from None
if x_self_id in self._clients:
logger.warning("There's already a reverse websocket api connection,"
logger.warning("There's already a reverse websocket connection,"
"so the event may be handled twice.")
bot = BotClass(self, "http", self.config, x_self_id)
@ -178,6 +178,11 @@ class Driver(BaseDriver):
await ws.close(code=status.WS_1008_POLICY_VIOLATION)
return
if x_self_id in self._clients:
logger.warning("There's already a reverse websocket connection, "
f"<y>{adapter.upper()} Bot {x_self_id}</y> ignored.")
await ws.close(code=status.WS_1008_POLICY_VIOLATION)
bot = BotClass(self, "websocket", self.config, x_self_id, websocket=ws)
await ws.accept()