title: How to create a function for a command that processes concurrently
body: <p>When I type the command <code>!sleeper</code> into the discord, then immediately after type <code>!hello</code>. The bot is basically on pause for 10 seconds because it is processing <code>!sleeper</code>. After the 10 seconds it sends the message <code>I have been sleeping for 10 seconds</code> and then immediately after <code>Hello partner!</code>. How can I make it so the entire bot is not &quot;paused&quot; if someone sends the <code>!sleeper</code> command.</p>
  <p>What's happening now:</p>
  <ol>
  <li>I type <code>!sleeper</code></li>
  <li>I Type <code>!hello</code></li>
  <li>Bot waits 9-10 seconds</li>
  <li>Bot sends <code>I have been sleeping for 10 seconds</code></li>
  <li>Bot sends <code>Hello partner!</code></li>
  </ol>
  <p>What I want:</p>
  <ol>
  <li>I type <code>!sleeper</code></li>
  <li>I Type <code>!hello</code></li>
  <li>Bot sends <code>Hello partner!</code></li>
  <li>Bot waits 9-10 seconds</li>
  <li>Bot sends <code>I have been sleeping for 10 seconds</code></li>
  </ol>
  <p>PS: I wrote &quot;waits 9-10 seconds&quot; because it takes me about a second to type <code>!hello</code></p>
  <pre><code>import time
  
  from discord.ext import commands
  
  
  class Hello(commands.Cog):
      def __init__(self, client):
          self.client = client
  
      @commands.Cog.listener()
      async def on_ready(self):
          print(f'{self.__class__.__name__} Cog is ready')
  
      @commands.command()
      async def hello(self, ctx):
          await ctx.send('Hello partner!')
  
      @commands.command()
      async def sleeper(self, ctx):
          await self.sleep_now()
          await ctx.send('I have been sleeping for 10 seconds')
  
      async def sleep_now(self):
          time.sleep(10)
  
  def setup(client):
      client.add_cog(Hello(client))
  </code></pre>