Skip to content

Conversation

@MrSnowball-dev
Copy link
Contributor

Add support for an expandable blockquote tag, at least in HTML format.

Maybe it can be done in a more complete way and without introducing a new tag, but I wasn't able to hack my way around it.

Add support for an expandable blockquote tag.
@Lonami
Copy link
Member

Lonami commented Apr 25, 2025

This is stretching "no new features" in v1 a bit too much.

Perhaps the code can instead be refactored, so that it's easier for users to add what they need "from the outside".

@HBcao233
Copy link
Contributor

I've previously submitted a similar pr, but it was rejected as a new feature. ah...But since it's a feature that exists in the official Bots API, adding it should be considered a bug fix, right?So I'm currently using a monkey patch.

from dowhen import when
from telethon.extensions.html import HTMLToTelegramParser

def html_callback(attrs, args):
  if 'expandable' in attrs.keys():
    args['collapsed'] = True
    return {'args': args}

when(HTMLToTelegramParser.handle_starttag, 'EntityType = MessageEntityBlockquote').do(
  html_callback
)

@Lonami
Copy link
Member

Lonami commented Nov 13, 2025

But since it's a feature that exists in the official Bots API

Telethon's formatting is not 100% compatible with Bot API's and that was on purpose. Aligning with them would be a breaking change.

TBH I just wish v2 was in a ready state so we could actually use that as an opportunity to align.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants