Skip to content
Advertisement

Discord.py – which way should I pick? [closed]

Recently I’ve known that developers are able to code Discord.py bot in 2 ways (or even more):

  1. To code every command as if message.content.startswith("hello"):
  2. Or to code every command as async def hello(ctx):

So, which type is more productive and better? Thank you

Advertisement

Answer

If you need commands, use the commands extension. Docs: https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html

Why should I use the commands extension?

  • Prevents spaghetti code
  • Better performance
  • Easy handling and processing of command arguments
  • Argument type converters
  • Easy subcommands
  • Command cooldowns
  • Built-in help function
  • Easy prefix management
  • Command checks, for controlling when they’re to be invoked
  • Ability to add command modules via extensions/cogs
  • Still able to do everything you can do with the first way
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement