From 586e8ec4e2d011bdcd250798db8b3cfff2f3d355 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:00:30 +0100 Subject: [PATCH] fix: bad wspace handling --- github-bot/src/main.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/github-bot/src/main.ts b/github-bot/src/main.ts index 0919a1640..e1d59b9fd 100644 --- a/github-bot/src/main.ts +++ b/github-bot/src/main.ts @@ -96,7 +96,10 @@ app.webhooks.on(["issue_comment.created"], async ({ octokit, payload }) => { const body = payload.comment.body.trim(); if (body.startsWith("+bot")) { - const cmd = body.split(" ")[1]?.replace(/[^a-z]/u, ""); + const cmd = body + .split("\n")[0]! + .split(/\s+/u)[1] + ?.replace(/[^a-z]/u, ""); switch (cmd) { case "ping": {