feat(deps): python-telegram-bot 21.5 -> 22.8
Build & Deploy ResearchOwl / build-and-push (push) Successful in 49s
Build & Deploy ResearchOwl / build-and-push (push) Successful in 49s
Salto mayor revisado contra el changelog oficial: - La 22.0 elimina lo deprecado en v20.x. De esa lista el bot solo usaba disable_web_page_preview (3 sitios), que ademas resulta seguir vivo como shim en 22.8 — se migra igualmente a link_preview_options, que es la API canonica desde Bot API 7.0. - No usamos quote=, proxy_url, ni *_timeout en run_polling (el resto de eliminaciones). Python >=3.10 (imagen 3.12) y httpx >=0.27,<0.29 (tenemos 0.28.1) OK. - Verificado aislado: import de src.bot.bot sin DeprecationWarnings, 8 tests en verde. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
5876361ac7
commit
2cb0cf841c
+1
-1
@@ -1,5 +1,5 @@
|
||||
# Core
|
||||
python-telegram-bot==21.5
|
||||
python-telegram-bot==22.8
|
||||
httpx==0.28.1
|
||||
aiohttp==3.14.1
|
||||
|
||||
|
||||
+7
-4
@@ -10,7 +10,7 @@ from typing import Optional
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
import structlog
|
||||
from telegram import Update, Message
|
||||
from telegram import Update, Message, LinkPreviewOptions
|
||||
from telegram.ext import (
|
||||
Application, CommandHandler, MessageHandler,
|
||||
filters, ContextTypes
|
||||
@@ -397,7 +397,7 @@ async def cmd_generate(update: Update, ctx: ContextTypes.DEFAULT_TYPE):
|
||||
await update.message.reply_text(
|
||||
generator.last_publish_notice,
|
||||
parse_mode=ParseMode.MARKDOWN,
|
||||
disable_web_page_preview=True,
|
||||
link_preview_options=LinkPreviewOptions(is_disabled=True),
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning("Failed to send SEO summary message", error=str(e))
|
||||
@@ -526,7 +526,10 @@ async def cmd_news(update: Update, ctx: ContextTypes.DEFAULT_TYPE):
|
||||
|
||||
items = [item_from_row(r) for r in recent]
|
||||
for chunk in format_digest(items):
|
||||
await update.message.reply_text(chunk, disable_web_page_preview=False)
|
||||
# Previews activos a propósito (el digest gana con la tarjeta del link).
|
||||
await update.message.reply_text(
|
||||
chunk, link_preview_options=LinkPreviewOptions(is_disabled=False)
|
||||
)
|
||||
finally:
|
||||
await db_conn.close()
|
||||
|
||||
@@ -969,7 +972,7 @@ async def _scheduler_loop(app: Application):
|
||||
for c in chunks:
|
||||
await app.bot.send_message(
|
||||
chat_id=news_chat_id, text=c,
|
||||
disable_web_page_preview=False,
|
||||
link_preview_options=LinkPreviewOptions(is_disabled=False),
|
||||
)
|
||||
# Marca todos los pendientes (incluidos los "…y N más")
|
||||
await db.mark_news_notified([r["id"] for r in pending])
|
||||
|
||||
Reference in New Issue
Block a user