mirror of
https://github.com/father-bot/chatgpt_telegram_bot.git
synced 2026-08-03 13:27:16 +03:00
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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user