A pycord extension that allows splitting command groups into multiple cogs
Project description
pycord-multicog
A pycord extension that allows splitting command groups into multiple cogs.
Installation
Requires pycord v2.5 or higher.
$ pip install pycord-multicog
Usage
Initialising bot
from pycord.multicog import Bot
bot = Bot(...)
Creating commands
# cog number 1, a normal cog with a slash command group
class Cog1(Cog):
group = SlashCommandGroup("group")
@group.command()
async def subcommand1(self, ctx):
await ctx.respond("This is a normal subcommand.")
# cog number 2, has a command used with add_to_group
from pycord.multicog import subcommand
class Cog2(Cog):
@subcommand("group") # this subcommand depends on the group defined in Cog1
@slash_command()
async def subcommand2(self, ctx):
await ctx.respond("This subcommand is inside a different cog.")
@subcommand("group", independent=True) # this subcommand is independent
@slash_command()
async def subcommand2(self, ctx):
await ctx.respond("This subcommand is also inside a different cog.")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pycord-multicog-2.0.0.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for pycord_multicog-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d86238b4f057f959f547c4ffa363cbd72ec688e1dd7cb4c88fb7e41a135d4984 |
|
MD5 | 69e6d0435888ff631a06768767d514cd |
|
BLAKE2b-256 | 02475bc026631df7deee1f1381d81221e06571b5460ac265ffdbc7336da8d502 |