Skip to main content

A pycord extension that allows splitting command groups into multiple cogs

Project description

pycord-multicog

Downloads Discord

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.0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycord_multicog-2.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pycord-multicog-2.0.1.tar.gz.

File metadata

  • Download URL: pycord-multicog-2.0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for pycord-multicog-2.0.1.tar.gz
Algorithm Hash digest
SHA256 bdf08a9180dc7dd132aedbe96c6f0b8bf0fac25062ba9ce41a05c35645e7b8eb
MD5 ea8d982bd8a626dd108790e8188ca2cc
BLAKE2b-256 06f923e600b1200283d75cd90bcb03db67d81d312c3ad2116609c057345a129e

See more details on using hashes here.

File details

Details for the file pycord_multicog-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pycord_multicog-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e41c30c7c1d359ee4139a14da454f5a238fe0778af54980bca51b84cf25e22c5
MD5 75995154086a2635aefbf245fa24e7ef
BLAKE2b-256 4b2e73e3bfb000ce17657fe32181e336b2952adf7847f55baf08249c7a03ee43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page