Skip to main content

An extension module for disnake to load cogs without needing the setup function.

Project description

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.

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

disnake-cog-loader-0.0.3.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file disnake-cog-loader-0.0.3.tar.gz.

File metadata

  • Download URL: disnake-cog-loader-0.0.3.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for disnake-cog-loader-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5d1b8b77b03dcf1889be9a4320d4187ba4494c75c097272e8bd3a29e0334e279
MD5 249b13c3dc8651ec0e7082312dc347a2
BLAKE2b-256 00bdae229fe89e4d8b81c806d54dc2062f437f8ff64d38c8d504c95ea24d7585

See more details on using hashes here.

Supported by

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