Answer the question
In order to leave comments, you need to log in
How to save user messages in a bot to a separate file?
I use the Telebot library
Question. How to save user messages in a separate file? All messages must be saved.
Answer the question
In order to leave comments, you need to log in
@bot.message_handler(content_types=['text'])
def get_text_messages(message):
f=open('db.txt', 'a')
f.write(message.text)
f.close
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question