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 osclient = 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:
returnif message.content.startswith('$hello'): await message.channel.send('Hello!')
client.run(TOKEN)