Skip to content

Commit

Permalink
fix(core): server should not receive messages before connect
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Sep 4, 2020
1 parent c42bf77 commit ddc7329
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/koishi-core/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { camelCase, paramCase, sleep } from 'koishi-utils'
import { Session, MessageType, Meta } from './session'
import { App } from './app'
import { App, AppStatus } from './app'
import * as http from 'http'
import type Koa from 'koa'
import type Router from 'koa-router'
Expand Down Expand Up @@ -44,6 +44,7 @@ export abstract class Server {
}

prepare(data: any) {
if (this.app.status !== AppStatus.open) return
const meta = camelCase<Meta>(data)
if (!this.bots[meta.selfId]) {
const bot = this.bots.find(bot => !bot.selfId)
Expand Down

0 comments on commit ddc7329

Please sign in to comment.