title: Why am I getting a `AttributeError: 'NoneType' object has no attribute 'send'` Error
body: <p>It worked once then never again, I'm trying to load my log channel from a .env file which is working and loading fine, but when I go to send a log message to my log channel I get <code>AttributeError: 'NoneType' object has no attribute 'send'</code></p>
  <p>The ID is correct and I have given the bot explicit permission to send in that channel, but the error persists.</p>
  <pre><code># Load Bot token
  load_dotenv()
  TOKEN = os.getenv('DISCORD_TOKEN')
  CHANNEL = os.getenv('LOG_CHANNEL')
  
  # Set Bot command prefix
  prefix = 'Q!'
  bot = commands.Bot(command_prefix=prefix)
  channel = bot.get_channel(CHANNEL)
  </code></pre>
  <p>The .env file has <code>LOG_CHANNEL = 512123500123652096</code> and it loads it correctly, marking <code>CHANNEL</code> as int() doesn't help either</p>
  <p>This is the first thing the bot does when it turns on</p>
  <p>This is where I log, it's inside a command at the end</p>
  <pre><code># Log command
  command = discord.Embed(description=f&quot;File unzipped in {ctx.channel.mention}&quot;, color=0x4040EC).set_author(name=ctx.author, icon_url=ctx.author.avatar_url)
  command.add_field(name=&quot;File&quot;, value=f'{filename}')
  command.timestamp = ctx.message.created_at
  await channel.send(embed=command)
  </code></pre>