supercog

A project that assists in making a Discord bot. Includes HTML and Markdown support.


Keywords
discord, bot, cogs, extensions, command, category, html, markdown, pypi
License
MIT
Install
pip install supercog==2.3.1

Documentation

Discord Command Category

A project that includes modular categories for Discord commands and a simple Command class

What does this do?

When creating a Discord bot, there are multiple ways to go about adding commands to it:

  1. Create a method with decorators.
@bot.command
async def helloWorld(ctx, text):
  await ctx.send("Hello World! I am alive {}".format(
    text
  ))
  1. Load extensions into the bot using add_cog In cog.cog
class Cog:
 def __init__(self, bot):
   self.bot = bot
   ...
   # Other command stuff
 async def on_message(self, message):
   # Do stuff

In main.py

bot.load_extension("cog.cog")
# Do stuff

With this project, there is a simple way to control multiple aspects of commands.

  • Command parameters
  • Accepted parameters
  • Error messages
  • Restrictions
  • Can it be run in a private message?

While, yes, there is a way to include all that using other decorators, this project is highly modular and allows for changing very few things when adding or changing a command. This also supports automatic HTML rendering and creating a Markdown of the commands.