1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Fixed a bug in user_link

`user_link` returned an empty string if `include_id` was set to False
This commit is contained in:
SwissCorePy 2021-06-09 16:20:42 +02:00
parent ed5e5e5077
commit ab05cb0045

View File

@ -303,7 +303,7 @@ def user_link(user: types.User, include_id: bool=False) -> str:
"""
name = escape(user.first_name)
return (f"<a href='tg://user?id={user.id}'>{name}</a>"
+ f" (<pre>{user.id}</pre>)" if include_id else "")
+ (f" (<pre>{user.id}</pre>)" if include_id else ""))
def quick_markup(values: Dict[str, Dict[str, Any]], row_width: int=2) -> types.InlineKeyboardMarkup: