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

The activity always contains a mention of the bot regardless of whether it was actually mentioned or not #6667

Open
jorgeajimenezl opened this issue Aug 29, 2024 · 3 comments
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@jorgeajimenezl
Copy link

jorgeajimenezl commented Aug 29, 2024

Version

4.16.1

Describe the bug

It is basically the same issue than #2044

Expected behavior

I expect to only have a mention among the entities when the bot it is really mentioned

Additional context

Also, the bot only see messages that don't contains mentions or mention him directly, but if other user it's mentioned, it can see those messages, I don't even reach the bot

@jorgeajimenezl jorgeajimenezl added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels Aug 29, 2024
@dmvtech
Copy link
Collaborator

dmvtech commented Dec 24, 2024

@jorgeajimenezl If you are still experiencing this problem; what bot Channel are you using? Telegram also?

@jorgeajimenezl
Copy link
Author

@dmvtech Yes Telegram. I didn't check it again. Right now I'm solving it with this (this function is to know if the bot was mentioned in the message):

if activity.channel_id == "telegram":
    # TODO: https://github.com/microsoft/botframework-sdk/issues/6667
    try:
        entities = activity.channel_data["message"].get("entities")
        if not entities:
            return False
            
        for entity in entities:
            if entity.get("type") != "mention":
                continue
            offset = entity.get("offset")
            length = entity.get("length")
            return (
                activity.text[offset + 1 : offset + length]
                == conversation_reference.bot.id
            )
    except Exception:
        logger.warning("Telegram mention parsing failed", exc_info=True)
        return False

@dmvtech
Copy link
Collaborator

dmvtech commented Dec 27, 2024

How is the bot set up on the Telegram/BotFather side? What is the privacy mode?
https://core.telegram.org/bots/features#bot-management
Are you mentioning it such as /comand@botname ?

We need more steps on how to reproduce this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
Development

No branches or pull requests

2 participants