title: Python Discord Bot
body: <pre><code>import discord
  import os
  from dotenv import load_dotenv
  from discord.ext import commands
  import asyncio
  
  load_dotenv()
  DISCORD_TOKEN = os.getenv(&quot;DISCORD_TOKEN&quot;)
  bot = commands.Bot(command_prefix=&quot;$&quot;)
  channel = bot.get_channel(id_here)
  
  
  @bot.event
  async def on_ready():
      print(&quot;It's ready&quot;)
      while True:
          await asyncio.sleep(5)
          if channel:
              await bot.send_message(channel, 'hi')
              print(&quot;successfully sent message&quot;)
  
  bot.run(DISCORD_TOKEN)
  </code></pre>
  <p>My goal is to have the discord bot repeat itself every 5 seconds in my specific channel, though it's not working. I am getting this error</p>
  <pre><code>Ignoring exception in on_ready
  Traceback (most recent call last):
    File &quot;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py&quot;, line 333, in _run_event
      await coro(*args, **kwargs)
    File &quot;C:\Users\Administrator\Desktop\python\price.py&quot;, line 25, in on_ready
      await bot.send_message(channel, 'hi')
  AttributeError: 'Bot' object has no attribute 'send_message'
  </code></pre>