Desiders / telers

An asynchronous framework for Telegram Bot API written in Rust
https://docs.rs/telers
36 stars 3 forks source link

Added support "Expandable blockquote" feature from Bot API 7.4 #18

Closed doryan04 closed 5 months ago

doryan04 commented 5 months ago

A few days ago Bot API 7.4 was released, and it featured new entities - expandable blockquote.

...
Added support for “expandable_blockquote” entities in received messages.
Added support for “expandable_blockquote” entity parsing in “MarkdownV2” and “HTML” parse mode
...

Bot, written on telers, can't process message with new kind entity, and as result, bot will temporarily stop working. I suggest you to merge my branch with new Bot API feature.

Desiders commented 5 months ago

This solution will help to avoid an error, yes, but you should not use for ExpandableBlockquote entity Formatter::blockquote method, because they are not identical.

I think we need to add new method expandable_blockquote to Formatter trait like blockquote and implement it in HTMLFormatter and MarkdownFormatter.

Difference between expandable_blockquote and blockquote methods:

  1. HTML: <blockquote>{text}</blockquote> => <blockquote expandable>{text}</blockquote>
  2. Markdown: old code => old code + "||"
Desiders commented 5 months ago

Thanks for the commit, I will continue working in a separate branch