title: DISCORD: My Discord self bot takes too much time to load
body: <p>I coded a Discord self bot that sends a picture that acts like a global emote without nitro.</p>
  <p>Example:</p>
  <blockquote>
  <p>me: !ok</p>
  <p>me(bot): ok.png</p>
  </blockquote>
  <p>But when I edit my code and add more pictures and stuff and I load it again (By doing &quot;mybot.py&quot; in cmd) it takes around 5 minutes to finally print &quot;Self bot working.&quot; in the cmd window... what is the problem? I don't think it's a problem with my code because it's working overall. I'm using python 3.6 and windows.</p>
  <pre><code>import discord
  import asyncio
  
  client = discord.Client()
  
  @client.event
  async def on_ready():
      print(&quot;nonitro Loaded.\n&quot;)
      
  @client.event
  async def on_message(message):
      if message.author == client.user:
          if(message.content.startswith(&quot;!ok&quot;)):
              emo = &quot;./img/ok.png&quot;
              async for msg in client.logs_from(message.channel,limit=1):
                  await client.delete_message(msg)
                  await client.send_file(message.channel, emo)
                  
      if message.author == client.user:
          if(message.content.startswith(&quot;!xd&quot;)):
              emo = &quot;./img/xd.png&quot;
              async for msg in client.logs_from(message.channel,limit=1):
                  await client.delete_message(msg)
                  await client.send_file(message.channel, emo)
                  
      if message.author == client.user:
          if(message.content.startswith(&quot;!coffee&quot;)):
              emo = &quot;./img/coffee.png&quot;
              async for msg in client.logs_from(message.channel,limit=1):
                  await client.delete_message(msg)
                  await client.send_file(message.channel, emo)
                                  
      if message.author == client.user:
          if(message.content.startswith(&quot;!thonk&quot;)):
              emo = &quot;./img/thonk.png&quot;
              async for msg in client.logs_from(message.channel,limit=1):
                  await client.delete_message(msg)
                  await client.send_file(message.channel, emo)
                                  
      if message.author == client.user:
          if(message.content.startswith(&quot;!like&quot;)):
              emo = &quot;./img/like.png&quot;
              async for msg in client.logs_from(message.channel,limit=1):
                  await client.delete_message(msg)
                  await client.send_file(message.channel, emo)
                                  
      if message.author == client.user:
          if(message.content.startswith(&quot;!kek&quot;)):
              emo = &quot;./img/kek.png&quot;
              async for msg in client.logs_from(message.channel,limit=1):
                  await client.delete_message(msg)
                  await client.send_file(message.channel, emo)
                                                  
      if message.author == client.user:
          if(message.content.startswith(&quot;!bobross&quot;)):
              emo = &quot;./img/bobross.png&quot;
              async for msg in client.logs_from(message.channel,limit=1):
                  await client.delete_message(msg)
                  await client.send_file(message.channel, emo)
                                                  
      if message.author == client.user:
          if(message.content.startswith(&quot;!likethis&quot;)):
              emo = &quot;./img/likethis.png&quot;
              async for msg in client.logs_from(message.channel,limit=1):
                  await client.delete_message(msg)
                  await client.send_file(message.channel, emo)
  
  client.run(&quot;my token&quot;, bot=False)
  </code></pre>