Need help with Discord Bot

So I am doing the " Code a Discord Bot with Python - Host for Free in the Cloud" from the youtube channel of freecodecamp.

I am stuck at the $hello command. Everything is running fine, but the problem im facing is that when I type $hello in the discord I do not get a reply all my code is exactly the same. I know it is outdated the video, but can someone help me how I would make the bot respond?

Here is the code:

import discord
import os

client = discord.Client(intents=discord.Intents.default())
TOKEN = os.environ[‘area_51’]

@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(TOKEN)

I have found the solution:
https://discordpy.readthedocs.io/en/stable/quickstart.html

Sorry for the unnecessary question, but hope that link helps anyone in the future :slight_smile:

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