Skip to content

Commit

Permalink
fix(core): adapter is optional, should use ?. (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anillc authored Jun 2, 2023
1 parent a6054e0 commit fc5f82d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export abstract class Bot<T extends Bot.Config = Bot.Config> {
this.status = 'connect'
try {
await this.context.parallel('bot-connect', this)
await this.adapter.start(this)
await this.adapter?.start(this)
} catch (error) {
this.offline(error)
}
Expand All @@ -79,7 +79,7 @@ export abstract class Bot<T extends Bot.Config = Bot.Config> {
this.status = 'disconnect'
try {
await this.context.parallel('bot-disconnect', this)
await this.adapter.stop(this)
await this.adapter?.stop(this)
} catch (error) {
this.context.emit('internal/warning', error)
this.offline()
Expand Down

0 comments on commit fc5f82d

Please sign in to comment.