Reputation: 1
I just started learning discordpy but i got stuck after my bot wasn't responding even though i followed the documentation and no error messages. The bot is online but doesn't respond to my messages. Im using python 3.8
import discord
client = discord.Client()
@client.event
async def onmessage(message):
message.content.lower()
if message.content.startswith("hello"):
await message.channel.send("Hello!")
client.run('token')
Upvotes: 0
Views: 250
Reputation: 1
Change onmessage
to on_message
.
Also do from discord.ext import commands
.
That is what you are missing because in order to use @client.event
you must have discord.ext imported...Your code should work after that
Upvotes: 0