title: Discord.py 2.0 - Getting context for a HybridCommand
body: <p>I am trying to write a slash command version of my help command, and I want to check if a user can run a command.<br />
  This is my code here:</p>
  <pre class="lang-py prettyprint-override"><code>@app_commands.command(name=&quot;help&quot;)
  async def help(self, interaction: discord.Interaction, input: str = None):
      embed = discord.Embed(title=&quot;Test&quot;)
  
      cmd = self.bot.get_command(input)
  
      ctx: commands.Context = await self.bot.get_context(interaction)
  
      try:
          await cmd.can_run(ctx)
          embed.add_field(name=&quot;Usable by you:&quot;, value=&quot;Yes&quot;)
      except commands.CommandError as exc:
          embed.add_field(name=&quot;Usable by you:&quot;, value=f&quot;No:\n{exc}&quot;)
  
      await ctx.send(embed=embed)
  </code></pre>
  <p>Now this works fine if I want to check for a normal command (<code>commands.Command</code>), however this does not work with Hybrid Commands (<code>commands.HybridCommand</code>). I read <a href="https://discordpy.readthedocs.io/en/latest/ext/commands/api.html?highlight=get_context#discord.ext.commands.Bot.get_context" rel="nofollow noreferrer">the docs for <code>bot.get_context</code></a> where it says:<br />
  <code>In order for the custom context to be used inside an interaction-based context (such as HybridCommand) then this method must be overridden to return that class.</code><br />
  However I am not sure what this means exactly. How do I override it and what class do I need to return?</p>
  <p>For completions sake, here is the error I get when I try to use this on a HybridCommand:</p>
  <pre><code>discord.app_commands.errors.CommandInvokeError: Command 'help' raised an exception: AttributeError: '_MissingSentinel' object has no attribute 'guild'
  </code></pre>
  <p>Again, when I use this on a normal command it works fine.</p>
  <p>I would greatly appreciate any pointer!</p>
  <p>Edit: An example of what I mean:</p>
  <pre class="lang-py prettyprint-override"><code>    @commands.command()
      @commands.has_permissions(administrator=True)
      async def test1(self, ctx):
          print(&quot;Test1&quot;)
  
      @commands.hybrid_command()
      @commands.has_permissions(administrator=True)
      async def test2(self, ctx):
          print(&quot;Test 2&quot;)
  </code></pre>
  <p>If you input <code>/help test1</code>, it will work fine, but error out on <code>/help test2</code>. Without the permission check it seems to also work fine.</p>