title: Discord.py error while trying to create a private channel
body: <p>I wanted to make a private channel when a user runs a simple command. The code is below:</p>
  <pre class="lang-py prettyprint-override"><code>@client.command(name='start')
  async def createChannel(ctx):
      guild = ctx.guild
      member = ctx.author
      admin_role = get(guild.roles, name = &quot;Admin&quot;)
      overwrites = {
          guild.default_role: discord.PermissionOverwrite(read_messages=False),
          member: discord.PermissionOverwrite(read_messages=True),
          admin_role: discord.PermissionOverwrite(read_messages=True)
      }
      try:
          channel = await guild.create_text_channel('{}_sentinel'.format(ctx.author), overwrites=overwrites)
      except:
          print(&quot;Error&quot;)
  </code></pre>
  <p>Full traceback:</p>
  <pre><code>Ignoring exception in command start:
  Traceback (most recent call last):
    File &quot;/Users/raveeshyadav/Raveesh/sentinel/sentinel/lib/python3.9/site-packages/discord/ext/commands/core.py&quot;, line 85, in wrapped
      ret = await coro(*args, **kwargs)
    File &quot;/Users/raveeshyadav/Raveesh/sentinel/bot.py&quot;, line 44, in createChannel
      channel = await guild.create_text_channel('{}_sentinel'.format(ctx.author), overwrites=overwrites)
    File &quot;/Users/raveeshyadav/Raveesh/sentinel/sentinel/lib/python3.9/site-packages/discord/guild.py&quot;, line 948, in create_text_channel
      data = await self._create_channel(name, overwrites, ChannelType.text, category, reason=reason, **options)
    File &quot;/Users/raveeshyadav/Raveesh/sentinel/sentinel/lib/python3.9/site-packages/discord/guild.py&quot;, line 844, in _create_channel
      'id': target.id
  AttributeError: 'NoneType' object has no attribute 'id'
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File &quot;/Users/raveeshyadav/Raveesh/sentinel/sentinel/lib/python3.9/site-packages/discord/ext/commands/bot.py&quot;, line 939, in invoke
      await ctx.command.invoke(ctx)
    File &quot;/Users/raveeshyadav/Raveesh/sentinel/sentinel/lib/python3.9/site-packages/discord/ext/commands/core.py&quot;, line 863, in invoke
      await injected(*ctx.args, **ctx.kwargs)
    File &quot;/Users/raveeshyadav/Raveesh/sentinel/sentinel/lib/python3.9/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>Screenshot:</p>
  <p><a href="https://i.stack.imgur.com/IkSgU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IkSgU.jpg" alt="Error Screenshot" /></a></p>