I was following the YT tutorial on how to code a Discord bot on Python, and after writing the exact code as the video showed and following the exact same steps, the bot still does nothing when i give it commands.
The video I am referring to is Code a Discord Bot with Python - Host for Free in the Cloud - YouTube
Here’s the code I wrote, did I do anything wrong but can’t see it?
import discord
import os
client = discord.Client()
@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'))