title: Asyncio, await and infinite loops
body: <pre><code>async def start(channel):
      while True:
          m = await client.send_message(channel, "Generating... ")
          generator.makeFile()
          with open('tmp.png', 'rb') as f:
              await client.send_file(channel, f) 
          await client.delete_message(m)
          await asyncio.sleep(2)
  </code></pre>
  
  <p>I have a discord bot that runs a task every 2 seconds. I tried using an infinite loop for this, but the script crashes with a <code>Task was destroyed but it is still pending!</code> I have read about asyncio's coroutines, but none of the examples that I found use <code>await</code> in them. Is it possible avoid this error, by running a coroutine with <code>await</code>, for example? </p>