refactor(stars_bot): remove redundant notification calls
This commit is contained in:
@@ -167,28 +167,12 @@ class TelegramStarsBot:
|
|||||||
f"Пост {post_id} уже имеет комментарии. Пропускаю обработку."
|
f"Пост {post_id} уже имеет комментарии. Пропускаю обработку."
|
||||||
)
|
)
|
||||||
self.processed_manager.mark_processed(post_id)
|
self.processed_manager.mark_processed(post_id)
|
||||||
|
|
||||||
if self.notification_bot:
|
|
||||||
await self.notification_bot.failure(
|
|
||||||
post=post,
|
|
||||||
reason=f"пост уже имеет комментарии",
|
|
||||||
post_message_id=post_message_id,
|
|
||||||
)
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
post_content = post.get("post_body_html") or post.get("post_body")
|
post_content = post.get("post_body_html") or post.get("post_body")
|
||||||
if not post_content:
|
if not post_content:
|
||||||
logger.warning(f"У поста {post_id} отсутствует содержимое. Пропускаем.")
|
logger.warning(f"У поста {post_id} отсутствует содержимое. Пропускаем.")
|
||||||
self.processed_manager.mark_processed(post_id)
|
self.processed_manager.mark_processed(post_id)
|
||||||
|
|
||||||
if self.notification_bot:
|
|
||||||
await self.notification_bot.failure(
|
|
||||||
post=post,
|
|
||||||
reason=f"у поста отсутствует содержимое",
|
|
||||||
post_message_id=post_message_id,
|
|
||||||
)
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
links = TelegramLinkExtractor.extract(post_content)
|
links = TelegramLinkExtractor.extract(post_content)
|
||||||
|
|||||||
Reference in New Issue
Block a user