0

I’m just getting started with a discord.py bot in Pythonista but I am unsure as to why this starting code (copied from official docs) is not working - when I type “!test hello” the bot doesn’t reply, whereas when I used an “on_message” before, it worked fine. It also didn’t work when I tried it in PyCharm on a laptop. Any help appreciated. Thanks!

import discord
from discord.ext import commands

bot = commands.Bot(command_prefix='!')

@bot.command()
async def test(ctx, arg):
    await ctx.send(arg)


bot.run("myToken")
  • The code seems fine, Make sure to make an `on_ready` event and `print("bot is ready")` in it. The bot takes some time to start sometime so make an event or wait 10-20 seconds before trying. – NikoX Mar 28 '21 at 18:12

1 Answers1

0

Since I don't really see a problem, maybe you could try updating discord.py doing pip install -U discord.py

Pickl
  • 46
  • 6