Write telegram. bot, and I need to store the address that is entered from the keyboard. How to do it?

elif m.text == 'Yes':
 lol = m.message_id
print(lol)
 i = True
 while i:
 if m.message_id - lol != 1:
 f = open('order.txt', 'at+', encoding='utf-8')
 f.write('Address:' + str(m.text) + '\n')
f.close()
 doc = open('order.txt', 'rb')
 bot.send_document(config.cn, doc)
 bot.send_document(config.cn "FILEID")
os.remove('order.txt')
 bot.send_message(m.chat.id, 'Your order is already being prepared')
time.sleep(1)
 i = False

 else: 
 i = True
March 19th 20 at 09:11
1 answer
March 19th 20 at 09:13
link
And generally for such purposes I would recommend to use a database, so it will be faster and more convenient.

Find more questions by tags TelegramPython