Skip to content

Commit

Permalink
fix(satori): missing status, fix koishijs/koishi#1367, fix #241 (#242)
Browse files Browse the repository at this point in the history
Co-authored-by: Shigma <shigma10826@gmail.com>
  • Loading branch information
Lipraty and shigma authored Mar 10, 2024
1 parent f65dfac commit 94d40c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions adapters/satori/src/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class SatoriAdapter<C extends Context = Context> extends Adapter.WsClient
// Do not dispatch event from outside adapters.
let bot = this.bots.find(bot => bot.selfId === selfId && bot.platform === platform)
if (bot) {
bot.update(login)
if (login) bot.update(login)
return this.bots.includes(bot) ? bot : undefined
}

Expand All @@ -56,9 +56,10 @@ export class SatoriAdapter<C extends Context = Context> extends Adapter.WsClient
return
}
bot = new SatoriBot(this.ctx, login)
this.bots.push(bot)
bot.adapter = this
bot.http = this.http
this.bots.push(bot)
bot.status = login.status
}

accept() {
Expand Down

0 comments on commit 94d40c5

Please sign in to comment.