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
$ pip install pycord-multicog
Usage
Creating cogs
# 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 add_to_group
class Cog2(Cog):
@add_to_group("group") # the decorator that does the magic
@slash_command()
async def subcommand2(self, ctx):
await ctx.respond("This subcommand is inside a different cog.")
Applying multicog using apply_multicog
from pycord.multicog import apply_multicog
my_bot.add_cog(Cog1())
my_bot.add_cog(Cog2())
...
apply_multicog(my_bot) # manually apply multicog after cogs are loaded
Applying multicog using Bot subclass
from pycord.multicog import Bot
my_bot = Bot() # will automatically apply multicog when commands are being synchronised
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-1.0.2.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for pycord_multicog-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a5481ddf17b355f1dd4468b7671ed857935afbfb8fac7d69747deab28fe803e |
|
MD5 | 366bc12bd54e531e2a3abe833cdbe938 |
|
BLAKE2b-256 | 76f426cc3d4f50af61a73cda59cba89d75797758c3a33f53772e025070bff6ec |