From 3631d6534f2c0d8b834d63c820b71aade52540e8 Mon Sep 17 00:00:00 2001 From: Father Bot <153053814+father-bot@users.noreply.github.com> Date: Sun, 14 Jun 2026 13:45:46 +0300 Subject: [PATCH] fix: ignore unmentioned media in group chats; bump python-dotenv (#518) - unsupport_message_handle now checks is_bot_mentioned, so the bot stops replying "I don't know how to read files or videos" to videos/documents it wasn't mentioned in within group chats (#454). Private chats are unaffected (is_bot_mentioned returns True there). - Bump python-dotenv 1.0.1 -> 1.2.2 to resolve a Dependabot symlink-following advisory in set_key. - Bump version to 1.3.1 and document in CHANGELOG. --- CHANGELOG.md | 11 +++++++++++ VERSION | 2 +- bot/bot.py | 4 ++++ requirements.txt | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 065b12e..671f035 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this project are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.3.1] + +### Fixed +- In group chats the bot no longer replies "I don't know how to read files or + videos" to videos and documents it wasn't mentioned in — `unsupport_message_handle` + now respects the same `is_bot_mentioned` check as the other handlers (#454). + +### Security +- Bumped `python-dotenv` 1.0.1 → 1.2.2 to resolve a symlink-following advisory in + `set_key` (Dependabot). + ## [1.3.0] ### Removed diff --git a/VERSION b/VERSION index f0bb29e..3a3cd8c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.0 +1.3.1 diff --git a/bot/bot.py b/bot/bot.py index 04ac0e5..b1dce2d 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -329,6 +329,10 @@ async def _vision_message_handle_fn( return async def unsupport_message_handle(update: Update, context: CallbackContext, message=None): + # check if bot was mentioned (for group chats) + if not await is_bot_mentioned(update, context): + return + error_text = f"I don't know how to read files or videos. Send the picture in normal mode (Quick Mode)." logger.error(error_text) await update.message.reply_text(error_text) diff --git a/requirements.txt b/requirements.txt index 85c522e..fbfc44b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ openai>=1.40.0,<2.0.0 tiktoken>=0.7.0 PyYAML==6.0.2 pymongo==4.6.3 -python-dotenv==1.0.1 +python-dotenv==1.2.2