From 751aab1a26e6eed50f43866c232d3726492b3dc2 Mon Sep 17 00:00:00 2001 From: Open WebUI <15+open-webui@noreply.sakamoto.best> Date: Thu, 3 Sep 2026 16:17:46 +0000 Subject: [PATCH] Send ads as separate comment, remove probability logic --- modules/stars_bot.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/stars_bot.py b/modules/stars_bot.py index 8d6bf29..8b5ac01 100644 --- a/modules/stars_bot.py +++ b/modules/stars_bot.py @@ -288,19 +288,17 @@ class TelegramStarsBot: replies = self.config._load_replies() for reply_options in replies: reply_message = random.choice(reply_options) - - # Add ad with probability if ads are enabled - if self.config.enable_ads and random.random() < self.config.ads_probability: - ad_content = self.config._load_ads() - if ad_content: - # Add ad as a separate line/paragraph - reply_message = f"{reply_message}\n\n{ad_content}" - logger.info(f"Добавлена реклама к комментарию поста {post_id}") - await self.lolz_api.create_comment(post_id, reply_message) - await asyncio.sleep(self.config.api_delay) + # Send ad as a separate comment if enabled + if self.config.enable_ads: + ad_content = self.config._load_ads() + if ad_content: + await self.lolz_api.create_comment(post_id, ad_content) + logger.info(f"Отправлена реклама к посту {post_id}") + await asyncio.sleep(self.config.api_delay) + if self.notification_bot: await self.notification_bot.success( link=f"https://t.me/{channel}/{message_id}",