From 621fcd59f10e56e21aa01b84f03da395f711e535 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Mon, 23 Oct 2023 15:13:43 +0200 Subject: [PATCH] :children_crossing: (buttons) Trim items content when parsing reply for better consistency Closes #948 --- .../bot-engine/blocks/inputs/buttons/parseButtonsReply.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/bot-engine/blocks/inputs/buttons/parseButtonsReply.ts b/packages/bot-engine/blocks/inputs/buttons/parseButtonsReply.ts index 5dde38af2a..83c2c3e230 100644 --- a/packages/bot-engine/blocks/inputs/buttons/parseButtonsReply.ts +++ b/packages/bot-engine/blocks/inputs/buttons/parseButtonsReply.ts @@ -18,7 +18,9 @@ export const parseButtonsReply = (acc, item) => { if ( item.content && - acc.strippedInput.toLowerCase().includes(item.content.toLowerCase()) + acc.strippedInput + .toLowerCase() + .includes(item.content.trim().toLowerCase()) ) return { strippedInput: acc.strippedInput.replace(item.content ?? '', ''),