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.Botinstance to load cogs.
- The
folder_name- The folder where the cogs are located. You may also enter something like
ext.cogsif the cogs folder is inside a folder namedext.
- The folder where the cogs are located. You may also enter something like
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)
| 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
|