mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-06 20:16:47 +00:00
@ -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()
|
||||
|
Reference in New Issue
Block a user