Skip to main content

How to use

The first step is to let the extension know which class is the cog. Suppose the cog subclass is defined as FooCog,

class FooCog(commands.Cog):
    pass

You should name the file, foo_cog.py

The module will then convert snake_case to PascalCase and then try to import the cog to load it. The module will try to pass the bot instance to it so be sure to accept it in the constructor,

class FooCog(commands.Cog):
    def __init__(self, bot: commands.Bot):
        ...

disnake.ext.loader.Loader accepts two parameters, bot and folder_name.

  • bot
    • The commands.Bot instance to load cogs.
  • folder_name
    • The folder where the cogs are located. You may also enter something like ext.cogs if the cogs folder is inside a folder named ext.

Release files for disnake-cog-loader 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for disnake-cog-loader 0.0.3
File Size Uploaded
disnake-cog-loader-0.0.3.tar.gz 2.3 kB Details

Release files / disnake-cog-loader-0.0.3.tar.gz

Download URL disnake-cog-loader-0.0.3.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5d1b8b77b03dcf1889be9a4320d4187ba4494c75c097272e8bd3a29e0334e279
BLAKE2b-256 checksum
How to use checksums
00bdae229fe89e4d8b81c806d54dc2062f437f8ff64d38c8d504c95ea24d7585
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page