Answer the question
In order to leave comments, you need to log in
Telebot, how knowing the ID to make a link to the user?
I am making a telegram bot, a la a store where you can register a purchase, or order some kind of service, in general, just to make it easier.
I am writing as an education, purely for myself.
I can't figure out how to make it so that if the user clicks the "order" button, then the bot sends the "admin" not an id, but a link to the user, knowing his id, so that after that he can write to this user himself?
Answer the question
In order to leave comments, you need to log in
I found a solution through "mem = message.from_user.username", it returns the username, if not, then None.
As I understand it, making a link to a contact (t.me/...) of a person is not possible if he does not have a username, so this will probably be the only solution
I did:
bot.send_message(***id_admin** *,
f'Customer made a purchase!\n'
f'Customer: @{mem}\n'
f'Choice: {last_take_buy[-1]}',
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question