mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: Add support for custom emoji in markdown unparser
Some checks failed
Build-docs / build (push) Has been cancelled
Pyrofork / build (macos-latest, 3.10) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.11) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.12) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.13) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.9) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.10) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.11) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.12) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.13) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.9) (push) Has been cancelled
Some checks failed
Build-docs / build (push) Has been cancelled
Pyrofork / build (macos-latest, 3.10) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.11) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.12) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.13) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.9) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.10) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.11) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.12) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.13) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.9) (push) Has been cancelled
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
e58354c98a
commit
2de6d80905
1 changed files with 8 additions and 1 deletions
|
|
@ -234,11 +234,18 @@ class Markdown:
|
|||
# No closing delimiter for blockquotes
|
||||
else:
|
||||
url = None
|
||||
is_emoji = False
|
||||
if entity.type == MessageEntityType.TEXT_LINK:
|
||||
url = entity.url
|
||||
elif entity.type == MessageEntityType.TEXT_MENTION:
|
||||
url = f'tg://user?id={entity.user.id}'
|
||||
elif entity.type == MessageEntityType.CUSTOM_EMOJI:
|
||||
url = f"tg://emoji?id={entity.custom_emoji_id}"
|
||||
is_emoji = True
|
||||
if url:
|
||||
if is_emoji:
|
||||
insert_at.append((s, i, ''))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue