Skip to content

Commit

Permalink
fix:可注册非bot适配器
Browse files Browse the repository at this point in the history
  • Loading branch information
sj817 committed Mar 24, 2024
1 parent 93c586f commit 56e5ca1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ export default async function Server () {
try {
const Adapter = Bot.server[url]
const adapter = new Adapter(socket, request)
await adapter.isInit
Bot.adapter[headers['x-self-id']] = adapter
const id = headers['x-self-id']
if (id) {
await adapter.isInit
Bot.adapter[id] = adapter
}
} catch (e) {
logger.error(`[WebSocket连接][找不到适配器]:${url}`, e)
}
Expand Down

0 comments on commit 56e5ca1

Please sign in to comment.