From bb203a735638352fb8c718bc955ba76e93d44447 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Sun, 28 Jun 2026 18:47:29 +0300 Subject: [PATCH] Fix add line number: report list position, not internal id Co-Authored-By: Claude Sonnet 4.6 --- src/bot/bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bot/bot.py b/src/bot/bot.py index 4b9db26..46dc63a 100644 --- a/src/bot/bot.py +++ b/src/bot/bot.py @@ -141,7 +141,9 @@ class Bot(): rule = self.__config.add_subscription(src, ftype, value, dst, name=name) if rule is None: return "Already exists: {0} [{1}] '{2}' -> {3}".format(src, ftype, value, dst) - return "Added #{0}: {1}".format(rule['id'], rule.get('name', '')) + subs = self.__config.list_subscriptions() + line_no = next((i + 1 for i, s in enumerate(subs) if s['id'] == rule['id']), '?') + return "Added line {0}: {1}".format(line_no, rule.get('name', '')) if cmd in ('del', 'rm', 'delete'): line_no = int(parts[2]) subs = self.__config.list_subscriptions()