teloxide icon indicating copy to clipboard operation
teloxide copied to clipboard

teloxide::dispatching::dispatcher > Cannot parse an update - Looks like message quotes generate an error

Open foursixnine opened this issue 9 months ago • 2 comments

Hi,

$subject is being shown in the logs of a small bot I wrote to store messages... somehow I have the feeling that the culprit is the blockquote, but I tried other combinations and could not reproduce. See attached screenshot to see how it gets rendered

Initially I was looking into https://github.com/teloxide/teloxide/blob/bd98ba7e613e0fd7ec4fd1c210fc5edbb048f975/crates/teloxide-core/src/types/update.rs#L558 thiking it could be the place, but I see that negative numbers for id is already covered.

Steps to reproduce

I'm not entirely sure, asked the original sender to try and help reproduce it Untitled

Meta

  • teloxide version: 0.12.2

Additional context

Sorta cleaned up the data but looks like this: (also if there's a way to switch the error messages to produce json or another type that can be easily shared, even better)

"Object {
    "message": Object {
        "chat": Object {
            "id": Number(-1001437133807),
            "is_forum": Bool(true),
            "title": String("HIDDEN"),
            "type": String("supergroup")
        },
        "date": Number(1715621285),
        "entities": Array [
            Object {
                "length": Number(6),
                "offset": Number(0),
                "type": String("text_mention"),
                "user": Object {
                    "first_name": String("Pepe"),
                    "id": Number(404),
                    "is_bot": Bool(false),
                    "last_name": String("Perez")
                }
            }
        ],
        "from": Object {
            "first_name": String("Santiago"),
            "id": Number(469),
            "is_bot": Bool(false),
            "language_code": String("en"),
            "last_name": String("Zarate"),
            "username": String("foursixnine")
        },
        "is_topic_message": Bool(true),
        "message_id": Number(108063),
        "message_thread_id": Number(108051),
        "reply_to_message": Object {
            "chat": Object {
                "id": Number(-1001437133807),
                "is_forum": Bool(true),
                "title": String("HIDDEN"),
                "type": String("supergroup")
            },
            "date": Number(1715620229),
            "entities": Array [
                Object {
                    "length": Number(92),
                    "offset": Number(32),
                    "type": String("blockquote")
                },
                Object {
                    "length": Number(26),
                    "offset": Number(32),
                    "type": String("bold")
                }
            ],
            "forward_date": Number(1715602115),
            "forward_from": Object {
                "first_name": String("Pepe"),
                "id": Number(404),
                "is_bot": Bool(false),
                "last_name": String("Perez")
            },
            "forward_origin": Object {
                "date": Number(1715602115),
                "sender_user": Object {
                    "first_name": String("Pepe"),
                    "id": Number(404),
                    "is_bot": Bool(false),
                    "last_name": String("Perez")
                },
                "type": String("user")
            },
            "from": Object {
                "first_name": String("Santiago"),
                "id": Number(469),
                "is_bot": Bool(false),
                "language_code": String("en"),
                "last_name": String("Zarate"),
                "username": String("foursixnine")
            },
            "is_topic_message": Bool(true),
            "message_id": Number(108054),
            "message_thread_id": Number(108051),
            "text": String("Ya casi pues, con esto llegas: \nFalacia del hombre de paja\nfalacia informal en donde se tergiversa el argumento del oponente")
        },
        "text": String("Pepe que brujeria hiciste para que el mensaje quedara asi?")
    },
    "update_id": Number(760631562)
}";

foursixnine avatar May 13 '24 19:05 foursixnine

The "blockquote" field is missing in MessageEntityKind. See: Telegram MessageEntity

priv2024 avatar May 23 '24 19:05 priv2024

Therefore it is not possible to use blockquotes in messages with an inline keyboard because the update won't be parsed:

ERROR teloxide::dispatching::dispatcher               > Cannot parse an update.
...
This is a bug in teloxide-core, please open an issue here: https://github.com/teloxide/teloxide/issues.

priv2024 avatar May 23 '24 22:05 priv2024

So, this is another "breaking change" from the TBA 7.0, so we should initially make 6.9 (current is 6.8)

syrtcevvi avatar Jul 12 '24 08:07 syrtcevvi