title: Problem with error handling in discord.py
body: <p>Im trying to create error messages in my discord python bot with this code:</p>
  
  <pre><code>@purge.error
  async def clear_error(ctx, error):
      if isinstance(error, commands.MissingRequiredArgument):
          await ctx.send('Please specify the amount of messages you want to clear. Usage: //clear &lt;number&gt;')
      if isinstance(error, commands.MissingPermissions):
          await ctx.send('You do not have manage_messages permssion')
  </code></pre>
  
  <p>but im getting this error in the console:</p>
  
  <pre><code>Traceback (most recent call last):
    File "c:/projects/bad bot/bot.py", line 132, in &lt;module&gt;
      @purge.error
  AttributeError: 'function' object has no attribute 'error'
  </code></pre>
  
  <p>and I don't  understand why is it happening. </p>
  
  <p>If needed the purge command:</p>
  
  <pre><code>@client.command
  @commands.has_permissions(manage_messages=True)
  async def purge(ctx, amount : int):
      await ctx.channel.purge(limit=amount)
      await ctx.send('Done!')
  </code></pre>