Replies: 1 comment
-
You can use You can use something like that: user_id = 777
user_chat_info = bot.get_chat(user_id)
if not user_chat_info.has_private_forwards or user_chat_info.username:
markup.add(
InlineKeyboardButton(
text=user_chat_info.first_name,
url=f"tg://user?id={user_id}",
),
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What version of pyTelegramBotAPI are you using? pyTelegramBotAPI==4.14.0
What OS are you using? Windows
What version of python are you using? 3.12
Some users do not have a username, so I'm unable to mention them. Even tho that I have the telegram id. Any way to do so?
Beta Was this translation helpful? Give feedback.
All reactions