Skip to content

SendActivity begun failing with "Bad Request: can't parse entities" when talking with Telegram #6896

@justdmitry

Description

@justdmitry

Version

4.23.0

Describe the bug

We use Azure Bot Services to connect our bot to Telegram. Everything was working fine for over a year, but several days ago (June 2, ~6AM UTC) simple Microsoft.SendActivity begun failing when sending messages to Telegram with entity parsing errors. It seems that now it requires us to escape everything according to MarkdownV2 Telegram formatting rules.

To Reproduce

Steps to reproduce the behavior:

  1. Create new empty/blank bot in Azure Portal, add Telegram channel with some Telegram bot token, get AppId and AppPassword to connect to this bot from local instance;
  2. Create new bot in Bot Framework Composer (or from template)
  3. Add this action to Dialog json file to any place where bot response is expected:
{
    "$kind": "Microsoft.SendActivity",
    "activity": "Тest. Hello, World!"
},
  1. Talk with bot via Telegram and call this activity.

Bot will not send this message. Exception will be throw instead:

{"error":{"code":"ServiceError","message":"Bad Request: can't parse entities: Character '.' is reserved and must be escaped with the preceding '\'","innerHttpError":{"statusCode":400,"body":{"ok":false,"description":"Bad Request: can't parse entities: Character '.' is reserved and must be escaped with the preceding '\'","error_code":400}}}}

Bot will send message only when I manually perform Telegram escaping according to MarkdownV2 syntax:

{
    "$kind": "Microsoft.SendActivity",
    "activity": "Тest\\. Hello, World\\!"
},

So it looks like SendActivity not used any 'parse_mode' before June 2 and begun to use 'parse_mode=MarkdownV2' since June 2, but I can't find any related source changes. This doesn't even look like SDK bug, instead it looks like something have changed on Azure side, but I can't find any notifications about it. So, maybe I miss something important when using SendActivity?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or an unintended behavior.needs-triageThe issue has just been created and it has not been reviewed by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions