title: Discord.py ERROR sending message to channel
body: <pre><code> File &quot;/app/.heroku/python/lib/python3.10/site-packages/discord/ext/tasks/__init__.py&quot;, line 101, in _loop
   await self.coro(*args, **kwargs)
  2022-09-09T20:52:06.079611+00:00 app[worker.1]:   File &quot;/app/main.py&quot;, line 14, in test
  2022-09-09T20:52:06.079612+00:00 app[worker.1]:     channel.send(&quot;test&quot;)
  2022-09-09T20:52:06.079624+00:00 app[worker.1]: AttributeError: 'NoneType' object has no attribute 'send'
  </code></pre>
  <p>I'm using <code>discord.py</code> and I keep getting that error</p>
  <pre><code>import discord
  import os
  
  
  from discord.ext import commands
  from discord.ext import tasks
  
  client = commands.Bot(command_prefix='..')
  
  @tasks.loop(minutes=1)
  async def test():
   
      channel = client.get_channel(1017890755462824078)
      channel.send(&quot;test&quot;)
  
  
  @client.event
  async def on_ready():
      test.start()
      print(&quot;test&quot;)
  
  
  client.run(os.getenv(&quot;TOKEN&quot;))
  </code></pre>