@@ -55,7 +55,7 @@ class QueueManager:
|
|||||||
|
|
||||||
# Mantener solo los primeros NOTIFIED_ARTICLES_LIMIT artículos después de enviar
|
# Mantener solo los primeros NOTIFIED_ARTICLES_LIMIT artículos después de enviar
|
||||||
if len(self._notified_articles) > NOTIFIED_ARTICLES_LIMIT:
|
if len(self._notified_articles) > NOTIFIED_ARTICLES_LIMIT:
|
||||||
self._notified_articles = self._notified_articles[:NOTIFIED_ARTICLES_LIMIT]
|
self._notified_articles = self._notified_articles[NOTIFIED_ARTICLES_LIMIT:]
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.error(f"Error al enviar artículo a Telegram: {e}")
|
self.logger.error(f"Error al enviar artículo a Telegram: {e}")
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import threading
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
ITEM_HTML = """
|
ITEM_HTML = """
|
||||||
<b>Resultados para:</b> {search_name}
|
|
||||||
<b>Artículo:</b> {title}
|
<b>Artículo:</b> {title}
|
||||||
|
|
||||||
{description}
|
{description}
|
||||||
@@ -112,14 +111,16 @@ class TelegramManager:
|
|||||||
|
|
||||||
# Crear botones inline para el primer mensaje del grupo
|
# Crear botones inline para el primer mensaje del grupo
|
||||||
keyboard = [
|
keyboard = [
|
||||||
[InlineKeyboardButton("⭐ Añadir a favoritos", callback_data=f"fav_{article.get_id()}_{search_name}")]
|
[
|
||||||
|
InlineKeyboardButton("⭐ Añadir a favoritos", callback_data=f"fav_{article.get_id()}_{search_name}")
|
||||||
|
]
|
||||||
]
|
]
|
||||||
reply_markup = InlineKeyboardMarkup(keyboard)
|
reply_markup = InlineKeyboardMarkup(keyboard)
|
||||||
|
|
||||||
# Enviar un mensaje adicional con los botones (reply al primer mensaje del grupo)
|
# Enviar un mensaje adicional con los botones (reply al primer mensaje del grupo)
|
||||||
await self._bot.send_message(
|
await self._bot.send_message(
|
||||||
chat_id=self._channel,
|
chat_id=self._channel,
|
||||||
text="💾 Acciones:",
|
text="💾 Acciones",
|
||||||
reply_markup=reply_markup,
|
reply_markup=reply_markup,
|
||||||
reply_to_message_id=sent_messages[0].message_id,
|
reply_to_message_id=sent_messages[0].message_id,
|
||||||
message_thread_id=thread_id
|
message_thread_id=thread_id
|
||||||
|
|||||||
Reference in New Issue
Block a user