title: How to catch errors and send responses in discord.py?
body: <p>I want my bot to send a message to the chat when someone types a non-existent command. I tried this but nothing happened. Here is the code:</p>
  
  <pre><code>import discord
  from discord.ext import commands
  
  bot = commands.Bot(command_prefix=BOT_PREFIX)
  
  @bot.event
  async def on_ready():
      print("Logged in as: " + bot.user.name + "\n")
  
  @bot.command()
  async def asdasd(ctx):
      try:
          if asdasd:
              await ctx.send('asd')
      except discord.ext.commands.errors.CommandNotFound:
          await ctx.send('error')
  
  bot.run('My Token Here')
  </code></pre>