From 442e5279cc0940736f36a42c47eb56406aa1aea4 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Sun, 5 Apr 2026 01:57:56 +0000 Subject: [PATCH] fix: properly detect flags after -link and -date Previously, /edit 28 -link -date would treat -date as the link value. Now it checks if the next argument starts with "-" to detect flags. --- apps/telegram-bot/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/telegram-bot/commands.py b/apps/telegram-bot/commands.py index b13f56b..aa0ec9d 100644 --- a/apps/telegram-bot/commands.py +++ b/apps/telegram-bot/commands.py @@ -106,14 +106,14 @@ def parse_args( arg = args[i] if arg == "-link": - if i + 1 < len(args): + if i + 1 < len(args) and not args[i + 1].startswith("-"): link = args[i + 1] i += 2 else: clear_link = True i += 1 elif arg == "-date": - if i + 1 < len(args): + if i + 1 < len(args) and not args[i + 1].startswith("-"): due_date_ts = parse_date_with_tz(args[i + 1]) if due_date_ts is not None: i += 2