title: (Python 3.6) Discord bot refreshing a list based on non-existent names
body: <p>I'm trying to make a command that allows me to check every single name in a certain list that I have saved in a local .txt file and then seeing whether that name exists in a website's database and removes them from the list if they don't.</p>
  
  <p>The problem: The algorithm itself "works". However it skips certain lines of the file whenever I use the command. If I run the command multiple times it actually "does" its job, however I would prefer if it did it all in 1 go. What I think is wrong is the fact that each loop cycle does not wait for the other one to end so it just fails or something?</p>
  
  <pre><code>@client.command()
  async def refresh():
  
      try: ##this part of the code turns my txt file into an array
              with open('snipelist.txt') as f: lines = [line.rstrip('\n') for line in f]
              endstring = 'Removed from the list: \n'
              ##in this for loop I check if the name in the list exists inside of the website's database
              for line in lines:
                      request = requests.get('http://armory.warmane.com/api/character/'+line+'/Frostwolf/match-history')
                      content = request.content
                      soup = bs(content,'html.parser')
                      string = str(soup)
                      if 'Character does not exist' in string:
                              endstring = endstring + line + '\n'
                              lines.remove(line)
                              f = open('snipelist.txt','w')
                              for line in lines:
                                      f.write('%s\n' % line)
                              f.close()
  ##this is where I print on the chat itself
              await client.say(endstring)
      except Exception as e:
              print('Error caught during refresh command: ' + str(e))
  </code></pre>
  
  <p>Here are some existing names for the list:
  Purple, Smiling, Superman</p>
  
  <p>Here are some nonexisting names:
  Neeeew, Teeeest, Eeetcera</p>