From 689891dd8750691e70d15b8629d782e5b2341efc Mon Sep 17 00:00:00 2001 From: yiekheng Date: Sat, 9 May 2026 17:57:45 +0800 Subject: [PATCH] fix(bot): render custom day/hour/minute pickers as plain text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The day picker text included `(timezone: Asia/Kuala_Lumpur)` and the `_` in the IANA name triggered Markdown's italic delimiter — Telegram's parser then couldn't find the closing `_` and rejected the message with 400 'can't parse entities at byte offset 62'. Drop Markdown formatting for all three custom-time picker views (day, hour, minute) since they include system-generated content (timezones, day labels, dates) that may contain underscores or other markdown chars. --- apps/bot/src/telegram/menus.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/bot/src/telegram/menus.ts b/apps/bot/src/telegram/menus.ts index bf22081..ccbb694 100644 --- a/apps/bot/src/telegram/menus.ts +++ b/apps/bot/src/telegram/menus.ts @@ -401,9 +401,11 @@ export function reminderPickDayMenu(timezone: string): MenuView { keyboard.row(); } keyboard.text("⬅ Back", "rm_t:back"); + // Plain text — IANA timezone names contain `_` which Markdown reads as italic. return { - text: `📆 *Custom — Step 1 / 3*\n\nPick a day (timezone: ${timezone}):`, + text: `📆 Custom — Step 1 / 3\n\nPick a day (timezone: ${timezone}):`, keyboard, + parseMode: undefined, }; } @@ -425,8 +427,9 @@ export function reminderPickHourMenu(dayLabel: string, dayOffset: number): MenuV } keyboard.text("⬅ Back", "rm_t:custom"); return { - text: `📆 *Custom — Step 2 / 3*\n\nDay: ${dayLabel}\n\nPick an hour:`, + text: `📆 Custom — Step 2 / 3\n\nDay: ${dayLabel}\n\nPick an hour:`, keyboard, + parseMode: undefined, }; } @@ -448,10 +451,11 @@ export function reminderPickMinuteMenu( keyboard.text("⬅ Back", `rmd:${dayOffset}`); return { text: - `📆 *Custom — Step 3 / 3*\n\n` + + `📆 Custom — Step 3 / 3\n\n` + `Day: ${dayLabel}\nHour: ${String(hour).padStart(2, "0")}:00\n\n` + `Pick minutes:`, keyboard, + parseMode: undefined, }; }