mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 01:16:35 +03:00
Updated Sending more than just messages (markdown)
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)
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user