I wanna program a simple bot with the discord.py extension, using a tutorial to do so. Against my expectations, it doesn't work the way I want it to. The event listeners are working, but the command doesn't. Do you have any advices for me? Thanks.
import discord
from discord.ext import commands
from discord.ext.commands import Context
client = commands.Bot(command_prefix="&")
@client.event
async def on_ready():
print('The bot just started, thanks for reviving me.')
@client.event
async def on_message(message):
if message.author == client.user:
return
@client.command(
name="ping",
aliases=["p"]
)
async def ping_command(ctx: Context):
print("test")
await ctx.channel.send("Pong")
client.run('TOKEN')