Discord bot won't respond to my commands

Hello there! I’m new to creating and developing Discord bots. and I created a simple script:

import discord
import os

client = discord.Client(intents=discord.Intents.default())

@client.event
async def on_ready():
    print('We have logged in as {0.user}'.format(client))

@client.event
async def on_message(message):
    if message.author == client.user:
        return
      

    if message.content.startswith('$hello'):
     await message.channel.send('Hello!')

client.run(os.getenv('Token'))

And when I run it in console, it doesn’t give me any errors, and it says that it’s running, and Discord says that my bot is online.

Thank you for reading.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.