Answer the question
In order to leave comments, you need to log in
How can I teach a Telegram bot so that the bot sends messages from the user to my telegram?
I write a bot in Python. Certain answers (messages) of the user should come to my telegram.
How can I teach a Telegram bot so that the bot sends messages from the user to my telegram?
Thanks1
Answer the question
In order to leave comments, you need to log in
Here is the most obvious option. You write a function and call where it is convenient. Before that, enter your chat ID (my_chat_id) into the constants.
def log (message):
msg_to_me=str("Сообщение от: "+ message.from_user.first_name+" ID: "+str(message.from_user.id)+ "\nТекст: "+ message.text)
bot.send_message(constants.my_chat_id, msg_to_me)
Message From: Myza ID: 000000000000
Text: Hello! You are the best bot in the world....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question