title: Discord.py Python Bot the bot goes offline in discord after approximately 5 minutes. but continues to do its job
body: <p>Below is my code, I made a bot using Discord.Py, Its basis is to take a screenshot, then post the screenshot to discord, it is supposed to repeat this process every 5 minutes continuously. this works within my script, however after a bit the bot then goes offline in discord, and is no longer under its role, or under online members, and is shown offline. Is their a way to force the bot to stay online?</p>
  <pre><code>import pyautogui
  import pyscreeze
  import time
  import discord
  from discord.ext import tasks
  from discord.ext.commands import Bot
  from discord.ext import commands
  
  class MyClient(discord.Client) :
      async def on_ready(self):
          print('online')
          game = discord.Game(&quot;Watching Logs&quot;)
          await client.change_presence(status=discord.Status.online, activity=game)
          while True:
              time.sleep(300 - time.time() % 300) 
              im1 = pyscreeze.screenshot()
              im2 = pyscreeze.screenshot(r'C:\Users\Tyler\Desktop\discord-screenshot-bot-master\371logs.png')
              print('Screenshot Taken')
              time.sleep(5)
              channel = client.get_channel(780053606753239050)
              await channel.send('371 Logs')
              await channel.send(file=discord.File(r'C:\Users\Tyler\Desktop\discord-screenshot-bot-master\371logs.png'))
              print('Screenshot Posted to Discord')
  client = MyClient()
  client.run('token')
  
  </code></pre>