title: How to carry over arguments to error handling in discord.py
body: <p>I have a say command for my discord bot. The command works by asking for a channel and message. If the channel is left unfilled it will raise a <code>ChannelNotFound</code> error. I already handled that error but I want it to send the message in the channel the command was typed in if a <code>ChannelNotFound</code> is raised.</p>
  <p>Here is the command and error handler.</p>
  <pre class="lang-py prettyprint-override"><code>@client.command()
  async def say(ctx, channel: discord.TextChannel = None, *, message=None):
      if message is None:
          embed = discord.Embed(title=&quot;Say command&quot;,
                                description=&quot;Say something through It's Ez in a certain channel&quot;,
                                color=discord.Color.blue())
          embed.set_author(name=ctx.author.display_name, icon_url=ctx.author.avatar)
          embed.set_footer(text=&quot;Why was this message prompted? It's because you left message unfilled.&quot;)
          embed.add_field(name=&quot;Format&quot;, value=&quot;%say &lt;#channel or id&gt; &lt;message&gt;&quot;)
          await ctx.send(embed=embed)
      else:
          await channel.send(message)
  
      await ctx.message.delete()
  </code></pre>
  <pre class="lang-py prettyprint-override"><code>@say.error
  async def say_error(ctx, error):
      if isinstance(error, ChannelNotFound):
          embed = discord.Embed(title=&quot;Say command&quot;,
                                description=&quot;Say something through It's Ez in a certain channel&quot;,
                                color=discord.Color.blue())
          embed.set_author(name=ctx.author.display_name, icon_url=ctx.author.avatar)
          embed.set_footer(text=&quot;Why was this message prompted? It's because you left channel unfilled.&quot;)
          embed.add_field(name=&quot;Format&quot;, value=&quot;%say &lt;#channel or id&gt; &lt;message&gt;&quot;)
          await ctx.send(embed=embed)
      await ctx.message.delete()
  </code></pre>