My discord bot code isn't working and no clue how to fix

Question: don’t now what I’m doing wrong

Repl link:

import discord
import requests
import asyncio

client = discord.Client()

async def on_ready():
    print(f'We have logged in as {client.user}')

async def check_website():
    url = ""
    channel_id =
# Replace with your channel ID
    channel = client.get_channel(channel_id)
    while True:
            response = requests.get(url)
            if response.status_code == 200:
                await channel.send(f"🟢 {url} is up and running!")
                await channel.send(f"🔴 {url} is down! Status code: {response.status_code}")
        except Exception as e:
            await channel.send(f"❌ Error checking {url}: {e}")
        await asyncio.sleep(60)  # Check every 60 seconds

client.loop.create_task(check_website())'REDACTED - CHANGE ASAP')

I think you have intended to pass the method reference, not call the method.
check_website() should be check_website, the difference is that the first invokes it while the 2nd passes the method itself.


Please do not put your Discord API key in the code snippet, instead use Replit Secrets.


What exactly isn’t working?