bot.utils.extensions
#
Utilities for loading Discord extensions.
Module Contents#
Functions#
|
Return an unqualified name given a qualified module/package |
|
Return whether the module with name name should be ignored. |
|
Return all extension names from the given module. |
- bot.utils.extensions.unqualify(name: str) str [source]#
Return an unqualified name given a qualified module/package
name
.- Parameters:
name – The module name to unqualify.
- Return type:
The unqualified module name.
- bot.utils.extensions.ignore_module(module: pkgutil.ModuleInfo) bool [source]#
Return whether the module with name name should be ignored.
- bot.utils.extensions.walk_extensions(module: types.ModuleType) frozenset[str] [source]#
Return all extension names from the given module.
- Parameters:
module (types.ModuleType) – The module to look for extensions in.
- Return type:
A set of strings that can be passed directly to
discord.ext.commands.Bot.load_extension
.