Skip to content

Update formatting for new message entity date_time. Also optimize htm…#2570

Merged
Badiboy merged 4 commits intoeternnoir:masterfrom
Badiboy:master
Mar 8, 2026
Merged

Update formatting for new message entity date_time. Also optimize htm…#2570
Badiboy merged 4 commits intoeternnoir:masterfrom
Badiboy:master

Conversation

@Badiboy
Copy link
Collaborator

@Badiboy Badiboy commented Mar 8, 2026

Description

Update formatting for new message entity date_time. Also optimize html code to _subs

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the new date_time message entity type in apply_html_entities, and refactors the custom_emoji and text_link entity branches to use the centralized _subs dictionary instead of inline f-strings.

Changes:

  • Added "date_time" entry to the _subs template dictionary with the <tg-time> HTML tag.
  • Added a new elif branch in format_entity to handle date_time entities.
  • Refactored text_link and custom_emoji branches to use _subs templates instead of inline f-strings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +428 to +430
return _subs["custom_emoji"].format(emoji_id=entity.emoji_id, content=content)
elif entity_type == "date_time" and hasattr(entity, 'unix_time') and hasattr(entity, 'date_time_format'):
return _subs["date_time"].format(unix=entity.unix_time, date_time_format=entity.date_time_format, content=content)

This comment was marked as outdated.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Badiboy Badiboy merged commit 4db74cc into eternnoir:master Mar 8, 2026
10 checks passed
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.

2 participants