show real text for tg:// links
This commit is contained in:
parent
f832148537
commit
f38fce1550
3
main.py
3
main.py
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import traceback
|
import traceback
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from html import escape
|
from html import escape
|
||||||
@ -144,6 +145,8 @@ def _sign_text(text, m: Message, limit):
|
|||||||
if not text:
|
if not text:
|
||||||
text = ''
|
text = ''
|
||||||
|
|
||||||
|
text = re.sub(r'<a href="(tg://.*?)">.*?</a>', '<a href="\\1">\\1</a>', text)
|
||||||
|
|
||||||
sign = ''
|
sign = ''
|
||||||
if text.startswith('!sign') or text.startswith('/sign'):
|
if text.startswith('!sign') or text.startswith('/sign'):
|
||||||
text = text[5:]
|
text = text[5:]
|
||||||
|
Loading…
Reference in New Issue
Block a user