Tishka17 / aiogram_dialog

GUI framework on top of aiogram
https://aiogram-dialog.readthedocs.io
Apache License 2.0
683 stars 103 forks source link

LinkPreview widget #399

Open Tishka17 opened 6 months ago

Tishka17 commented 6 months ago
  1. If there is now LinkPreview in window - it is disabled. Can be also disabled in widget itself
  2. If it is rendered before ant text - show_above_text=True. Can be overriden by widget itself.
  3. URL - is any Text widget
  4. prefer_small_media and other bool flags can be set in widget

For example, in this code, link is shown above or below the text depedinging on when

Const("A", when="a")
LinkPreview()
Const("B", when="b")
Tishka17 commented 6 months ago

this feature requires refactoring in window rendering logic

Latand commented 1 month ago

I'd do that not with a separate widget, but with link_preview_options argument in the Window class then we just need to extend the api.entities.new_message.NewMessage class, if that's possible