Skip to content

Commit

Permalink
fix(core): do not send twice when return session.execute()
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Apr 1, 2021
1 parent d23c170 commit a2993f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .nycrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"packages/plugin-*/**/database/**",
"packages/plugin-*/**/database.js",
"packages/plugin-mongo/**",
"packages/plugin-mysql/**"
"packages/plugin-mysql/**",
"packages/plugin-webui/**"
]
}
5 changes: 3 additions & 2 deletions packages/koishi-core/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,9 @@ export class Session<
}

const result = await argv.command.execute(argv, next)
if (shouldEmit) await this.send(result)
return result
if (!shouldEmit) return result
await this.send(result)
return ''
}

middleware(middleware: Middleware) {
Expand Down

0 comments on commit a2993f7

Please sign in to comment.