title: Retrieve all chat ids using Telegram bot
body: <p>the main question is how do I get the chat ids for all the conversations ever held with the bot?</p>
  
  <p>Imagine that during the execution of the bot there is a conversation with the user A.</p>
  
  <p>Now I stop the bot process and start it again.</p>
  
  <p>How do I get the chat id of that past chat with the user A?</p>
  
  <p>I understand you get the chat id when the user sends you a message, and you use that id to reply, but what if user A no longer sends messages to the bot during the current execution? how to get the past conversation id?</p>
  
  <p>Is the only one option to store the ids and retrieve them when the second execution starts?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Looks like the current solution is to store the chat id somewhere safe, as answered by @Tick Tock.</p>