#Command decorators don't work subclassing

1 messages · Page 1 of 1 (latest)

silver remnant
#

I have a bot looking like this

class MyBot(commands.Bot):
  @command
  async def hw(self, ctx):
    await ctx.send("Hello world!")

but when I run it it tells that command is not defined

earnest frigate
#

the guide is in fact incorrect

#

it needs to be fixed

silver remnant
#

Do you know what the solution would be?

#

If I find it I'll make a pull request to fix the guide also

earnest frigate
#

construct the bot class and add a command like usual with the @bot.command() decorator