Answer the question
In order to leave comments, you need to log in
How to get chat_id telegram?
how to get your chat_id for bot? I am writing a bot that will send me data in private messages. telebot library.
is it possible to copy a unique identifier from the user's client and paste it into the bot code so that he writes messages to me?
I will be very grateful for your help
Answer the question
In order to leave comments, you need to log in
in the message handler, just add a line
print(message.chat.id)
and see what it displays in the console.
Or send the same message from the bot
id = message.chat.id
Where id is exactly the ID of the user the bot is writing to.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question