title: massban / massunban commands only work for users within the server. How can I make it so it also bans/unbans users not in the server?
body: <p>So I have been trying to create two commands — one that bans many users and another that lifts the ban of multiple users;massban and massunban.</p>
  <p>These two commands do work for users  that are in the server, the caveat is that it does not work to IDs that are not within the server.</p>
  <p>The idea here is to do !massban ID ID ID ID (...) and !massunban ID ID ID ID (...)</p>
  <pre><code>    @commands.command(name=&quot;massban&quot;)
      @commands.has_any_role(&quot;Admin&quot;, &quot;Moderator&quot;, &quot;Bot&quot;)
      async def massban(self, context, *user_ids: int):
          for u in user_ids:
              user_object = self.client.get_user(u)
              await context.guild.ban(user_object)
  
      @commands.command(name=&quot;massunban&quot;)
      @commands.has_any_role(&quot;Admin&quot;, &quot;Moderator&quot;, &quot;Bot&quot;)
      async def massunban(self, context, *user_ids: int):
          for u in user_ids:
              user_object = self.client.get_user(u)
              await context.guild.unban(user_object)
  </code></pre>
  <p>The problem is that this returns the error which is as follows</p>
  <p>The above exception was the direct cause of the following exception:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\Dazz\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\bot.py&quot;, line 903, in invoke
      await ctx.command.invoke(ctx)
    File &quot;C:\Users\Dazz\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py&quot;, line 859, in invoke
      await injected(*ctx.args, **ctx.kwargs)
    File &quot;C:\Users\Dazz\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py&quot;, line 94, in wrapped
      raise CommandInvokeError(exc) from exc
  discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'id'
  </code></pre>
  <p>I have been looking at documents, searching everywhere for a solution for this issue; I asked for help in a few Discord servers but to no avail.</p>
  <p>Any help would be appreciated.</p>