Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Bot Responding to Unmentioned GIFs and Videos #454

Open
bannedin40countries opened this issue Apr 16, 2024 · 2 comments · May be fixed by #457
Open

Issue with Bot Responding to Unmentioned GIFs and Videos #454

bannedin40countries opened this issue Apr 16, 2024 · 2 comments · May be fixed by #457

Comments

@bannedin40countries
Copy link

bannedin40countries commented Apr 16, 2024

Hi, I am encoutering an issue where the bot (v1.5) responds to GIFs and videos in group chats without being explicitly mentioned. The bot automatically replies with: "I don't know how to read files or videos. Send the picture in normal mode (Quick Mode)."

This behavior persists even though the bot is not mentioned or tagged. Is this a bug? Otherwise, I am looking for guidance or a fix to ensure that the bot only responds when directly mentioned or replying to its messages in group chats.

image

@hirakujira
Copy link

Yes, they forgot to block unmentioned video/file messages in the group chat

This is a quick fix:

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)
    return

@bannedin40countries
Copy link
Author

Yes, they forgot to block unmentioned video/file messages in the group chat

This is a quick fix:

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)
    return

This works. Thanks a bunch!

@hirakujira hirakujira linked a pull request Apr 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants