title: (Telegram bot/Pyrogram) How to make a text randomizer on Python that will be picking random text without a need to restart the code?
body: <p>I wanted to make a telegram bot which sends you a random word from text file (need that for a project) I made this:</p>
  <pre><code>import random
  lines = open('C:\\Users\\User\\Desktop\\singnplur.txt').read().splitlines()
  myline =random.choice(lines)
  
  @bot.on_message(filters.command('rng') &amp; filters.private)
  def command1(bot, message):
      bot.send_message(message.chat.id, myline)
  
  </code></pre>
  <p>And it works, but the word is being randomized only once and you need to restart the bot to pick another. What should i do?</p>