fix ws reverse

This commit is contained in:
yanyongyu 2020-08-21 15:42:33 +08:00
parent c1d0eae34b
commit b99c9688e2

View File

@ -157,12 +157,13 @@ class Driver(BaseDriver):
websocket = WebSocket(websocket)
# Create Bot Object
if adapter == "coolq":
bot = CQBot(self,
"websocket",
self.config,
x_self_id,
websocket=websocket)
if adapter in self._adapters:
BotClass = self._adapters[adapter]
bot = BotClass(self,
"websocket",
self.config,
x_self_id,
websocket=websocket)
else:
await websocket.close(code=status.WS_1003_UNSUPPORTED_DATA)
return