From 73e8e4b507715e4c853c79fd1d613172670bb3e5 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Sun, 28 Jun 2026 20:08:59 +0300 Subject: [PATCH] Fix !sub names: warm entity cache before resolving, show per-rule result get_entity fails silently for chats not yet cached in current session. Call get_dialogs() first to populate the cache, then resolve all titles. Show each updated name so it's clear what was resolved (and what wasn't). Co-Authored-By: Claude Sonnet 4.6 --- src/bot/bot.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bot/bot.py b/src/bot/bot.py index 6652e51..6e94450 100644 --- a/src/bot/bot.py +++ b/src/bot/bot.py @@ -177,8 +177,9 @@ class Bot(): subs = self.__config.list_subscriptions() if not subs: return "No subscriptions" - updated = 0 - for s in subs: + await self.__bot.get_dialogs() + lines = [] + for i, s in enumerate(subs, start=1): src = s.get('srcChatId') dst = s.get('action', {}).get('chatId') ftype = s.get('filter', {}).get('type', '') @@ -188,8 +189,8 @@ class Bot(): name = "[{0}] '{1}' = [{2}] {3} -> [{4}] {5}".format( ftype, value, src, src_title, dst, dst_title) self.__config.set_name(s['id'], name) - updated += 1 - return "Updated {0} names".format(updated) + lines.append("{0}. {1}".format(i, name)) + return "Updated {0} names:\n{1}".format(len(lines), "\n".join(lines)) async def __get_chat_title(self, chat_id: int) -> str: try: