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.
This commit is contained in:
Father Bot
2026-06-14 13:45:46 +03:00
committed by GitHub
parent 2435e7332b
commit 3631d6534f
4 changed files with 17 additions and 2 deletions
+11
View File
@@ -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/), 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). 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] ## [1.3.0]
### Removed ### Removed
+1 -1
View File
@@ -1 +1 @@
1.3.0 1.3.1
+4
View File
@@ -329,6 +329,10 @@ async def _vision_message_handle_fn(
return return
async def unsupport_message_handle(update: Update, context: CallbackContext, message=None): 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)." 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) logger.error(error_text)
await update.message.reply_text(error_text) await update.message.reply_text(error_text)
+1 -1
View File
@@ -3,4 +3,4 @@ openai>=1.40.0,<2.0.0
tiktoken>=0.7.0 tiktoken>=0.7.0
PyYAML==6.0.2 PyYAML==6.0.2
pymongo==4.6.3 pymongo==4.6.3
python-dotenv==1.0.1 python-dotenv==1.2.2