Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enetities to Message class #1396

Merged
merged 7 commits into from
Aug 30, 2023
Merged

Add enetities to Message class #1396

merged 7 commits into from
Aug 30, 2023

Conversation

mtalaeii
Copy link
Contributor

Add Entities classes

  • Make entity property as public
  • Add support for objects in getHTML method!

mtalaeii and others added 3 commits August 30, 2023 17:07
- Make entity property as public
- Add support for objects in getHTML method!
@danog
Copy link
Owner

danog commented Aug 30, 2023

Looks good, could you just add description to the entity classes?

@@ -117,46 +133,46 @@ public static function markdownToMessageEntities(string $markdown): \danog\Madel
/**
* Convert a message and a set of entities to HTML.
*
* @param list<array{_: string, offset: int, length: int, ...}> $entities
* @param list<MessageEntity> $entities
* @param bool $allowTelegramTags Whether to allow telegram-specific tags like tg-spoiler, tg-emoji, mention links and so on...
*/
public static function entitiesToHtml(string $message, array $entities, bool $allowTelegramTags = false): string
{
$insertions = [];
Copy link
Owner

Choose a reason for hiding this comment

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

Could you please convert the values $entities to objects if they're arrays?

@mtalaeii mtalaeii requested a review from danog August 30, 2023 18:21
@danog danog merged commit 1dce809 into danog:v8 Aug 30, 2023
@danog
Copy link
Owner

danog commented Aug 30, 2023

Thanks!

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