title: How to make the bot leave a guild with a command in discord.py?
body: <p>I want the bot leave a guild with a command . I tried this:</p>
  <pre><code> @commands.command()
      @commands.check(user_is_me)
      async def leave(self,guild_id):
          await self.bot.get_guild(int(guild_id)).leave()
  </code></pre>
  <p>But this throws me the following error,</p>
  <pre><code>Ignoring exception in command leave:
  Traceback (most recent call last):
    File &quot;C:\Users\Rohit\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py&quot;, line 83, in wrapped
      ret = await coro(*args, **kwargs)
    File &quot;c:\Users\Rohit\Desktop\discord bots\quotient\cogs\owner.py&quot;, line 47, in leave
      await self.bot.get_guild(int(guild_id)).leave()
  TypeError: int() argument must be a string, a bytes-like object or a number, not 'Context'
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File &quot;C:\Users\Rohit\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\bot.py&quot;, line 892, in invoke
      await ctx.command.invoke(ctx)
    File &quot;C:\Users\Rohit\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py&quot;, line 797, in invoke
      await injected(*ctx.args, **ctx.kwargs)
    File &quot;C:\Users\Rohit\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py&quot;, line 92, in wrapped
      raise CommandInvokeError(exc) from exc
  discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: int() argument must be a string, a bytes-like object or a number, not 'Context'
  </code></pre>
  <p>How do I solve it?</p>