Option to switch off telegram profile linking

This commit is contained in:
Davte 2019-07-19 22:59:32 +02:00
parent dba337f5dc
commit 81cf37b0eb

View File

@ -853,7 +853,7 @@ def get_cleaned_text(update, bot=None, replace=[], strip='/ @'):
return text.strip(strip)
def get_user(record):
def get_user(record, link_profile=True):
"""Get an HTML Telegram tag for user `record`."""
if not record:
return
@ -864,6 +864,7 @@ def get_user(record):
if (
'id' in from_
and from_['id'] is not None
and link_profile
):
result = f"""<a href="tg://user?id={from_['id']}">{{name}}</a>"""
if 'username' in from_ and from_['username']: