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 commands decorated with @subcommand
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.1.1.tar.gz
(4.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycord-multicog-2.1.1.tar.gz.
File metadata
- Download URL: pycord-multicog-2.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c56b916d14c06bc3695fdd591cd902a1394d13eaad8b1cadc3ea3e70696e71f
|
|
| MD5 |
4845aaef14e671589a67b659ee2cf0e7
|
|
| BLAKE2b-256 |
c17ebaa13ef1a35314f6732b77b2aee4f4e902cae22ea4dd99d95ec671ef4821
|
File details
Details for the file pycord_multicog-2.1.1-py3-none-any.whl.
File metadata
- Download URL: pycord_multicog-2.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
847328f9c49970e58c53d5eb19b945aad64ae95ba8b6dd40fa6b8b8ca3100c0f
|
|
| MD5 |
12ef320ab6bfda6302c3e76816fef7e3
|
|
| BLAKE2b-256 |
4b4ae5be5c68bf9a071b056df70960924185f25266d3b2cca3c74ce35a057769
|