refactor(config): load reply templates on demand

This commit is contained in:
2026-07-30 04:47:32 +05:00
parent 6a062f52d7
commit bb6cc70be9
2 changed files with 4 additions and 3 deletions
-1
View File
@@ -99,7 +99,6 @@ class Config:
"max_retries": max_retries,
"enable_reply": enable_reply,
"skip_commented": skip_commented,
"reply_templates": self._load_replies(),
}
except:
+4 -2
View File
@@ -214,7 +214,7 @@ class TelegramStarsBot:
await asyncio.sleep(self.config.api_delay)
if poster_user_id:
replies = self.config.reply_templates
replies = self.config._load_replies()
for reply_options in replies:
await asyncio.sleep(self.config.api_delay)
@@ -271,7 +271,9 @@ class TelegramStarsBot:
await self._process_single_post(post)
except Exception as e:
post_id = post.get("post_id", "?")
logger.error(f"Ошибка обработки поста {post_id}, пропускаю: {e}")
logger.error(
f"Ошибка обработки поста {post_id}, пропускаю: {e}"
)
if last_page > self.start_page:
logger.info(f"Мониторинг продвинулся до страницы {last_page}.")
self.start_page = last_page