From 659db3a80392f7c80a2d2e383847663d4c3f77e6 Mon Sep 17 00:00:00 2001 From: YunYouJun Date: Fri, 27 Sep 2024 02:34:57 +0800 Subject: [PATCH] fix(webhook): middleware return --- packages/el-bot/node/server/webhook/index.ts | 5 +++-- packages/el-bot/package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/el-bot/node/server/webhook/index.ts b/packages/el-bot/node/server/webhook/index.ts index 3bcb4b4..279123f 100644 --- a/packages/el-bot/node/server/webhook/index.ts +++ b/packages/el-bot/node/server/webhook/index.ts @@ -27,9 +27,10 @@ export function createWebhooks(app: BotServer, options: WebhooksOptions) { console.dir(payload) }) - const middleware = createNodeMiddleware(webhooks) + const middleware = createNodeMiddleware(webhooks, options.octokit.middlewareOptions) app.use(async (ctx, next) => { - await middleware(ctx.env.incoming, ctx.env.outgoing) + if (await middleware(ctx.env.incoming, ctx.env.outgoing)) + return await next() }) } diff --git a/packages/el-bot/package.json b/packages/el-bot/package.json index ea9c2cd..5692648 100644 --- a/packages/el-bot/package.json +++ b/packages/el-bot/package.json @@ -1,7 +1,7 @@ { "name": "el-bot", "type": "module", - "version": "1.0.0-beta.11", + "version": "1.0.0-beta.12", "description": "A quick qq bot framework for mirai.", "author": { "name": "云游君",