To add a module (discord.py extension), place any loading code into a global async def setup(bot):
. Note this function must be present (even if it does nothing) for the extension to load. This will be called on bot-admin calls to reloadExtensions
.
Please add commands as a Cog
unless the module is meant to explicitly extend base functionality. This will provide commands in a submenu of help
. You can use a GroupCog
for commands to be added as subcommands, while Cog
commands will be called as normal.
If you need to persist data, use save.addModuleTemplate(module_name, init_data)
with a dictionary of default values - this will be copied into each guild on use. This dictionary of stored values can be accessed using save.getModuleData(guild_id, module_name)
. After writing values, call save.save()
to persist to disk.
Please provide commands with a short description in help
for display in the help command. If you wish for help <command>
to return a more detailed command description set the more detailed text as description
.
help
will automatically display commands with their parameters obtained from the canonical parameter names; make these human-readable or manually set usage
to override the auto-generated names.
Useful components include:
components.embeds.EmbedContext
, which can be used to slightly more tidily construct embed repliescomponents.auth
, which can check if the user is a registered admin role or if the server has been registered to Hornet- NB: these methods should be added using the
commands.check()
decorator, allowing the help command to correctly identify whether the command can be executed
- NB: these methods should be added using the