Updated Sending more than just messages (markdown)

Mustafa 2023-04-02 13:05:28 +03:00
parent ecced2ccf1
commit 8c7a4eabd8

@ -91,6 +91,11 @@ class CustomMarkdown:
return text, entities
@staticmethod
def unparse(text, entities):
for i, e in enumerate(entities):
if isinstance(e, types.MessageEntityCustomEmoji):
entities[i] = types.MessageEntityTextUrl(e.offset, e.length, f'emoji/{e.document_id}')
if isinstance(e, types.MessageEntitySpoiler):
entities[i] = types.MessageEntityTextUrl(e.offset, e.length, 'spoiler')
return markdown.unparse(text, entities)
```