S
S
SunnyWolf2020-07-07 13:20:51
Python
SunnyWolf, 2020-07-07 13:20:51

How to get the participant id via reply?

I need to find out the id of the participant through a command, that is, I write a command to someone in response, for example /idu, and the bot sends the id of the participant to whom I answer.
I saw this post on Habré: Need to find out the user id via reply pytelegrambotapi?
but he didn't help me much

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-07-07
@NEDOprogrammer

Print message and find out what's in it.

@bot.message_handler(commands=['idu'])
def userid(message):
    print(message.reply_to_message.from_user.id)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question