modules.base.admin.module¶
Module Contents¶
Classes¶
Module repository. |
|
Bot administration functions. |
Attributes¶
- modules.base.admin.module.tr¶
- modules.base.admin.module.bot_log¶
- modules.base.admin.module.guild_log¶
- modules.base.admin.module.config¶
- class modules.base.admin.module.Repository(path: str, valid: bool, message: str, message_vars: dict = None, *, name: str = None, modules: tuple = None, version: str = None)¶
Module repository.
This object is used when working with the repo command.
- class modules.base.admin.module.Admin(bot)¶
Bot administration functions.
- cog_unload(self)¶
Cancel status loop on unload.
- async repository(self, ctx)¶
- async module(self, ctx)¶
- async config_(self, ctx)¶
- async config_get(self, ctx)¶
- async lemon_(self, ctx)¶
- async lemon_restart(self, ctx)¶
This won’t work without system-level error detection.
- async lemon_shutdown(self, ctx)¶
- static _download_repository(url: str, path: str) Optional[str]¶
Download repository to given directory.
- Parameters
url – A link to valid git repository.
path – Path for git to download the repository.
- Returns
An error that occured or
None.
- static _get_repository_list(query: str = '') List[str]¶
Get list of repositories
- Parameters
query – A string that has to be part of the module name.
- Returns
List of found module names.
- static _get_repository(path: str) Repository¶
Verify the module repository.
The file
__init__.pyhas to have variables__name__,__version__and__all__.__name__must be a valid name of only lowercase letters and-.__all__must be a list of modules, all of which have to exist as directories inside the directory the path points to. All modules must be lowercase ascii only.- Parameters
path – A path to cloned repository.
- Returns
Repositoryobject.
- static _install_module_requirements(path: str) Optional[subprocess.CompletedProcess]¶
Install new packages from requirements.txt file.
- Parameters
path – A Path to the repository.
- Returns
subprocess.CompletedProcessin case of succesfull installation,guilded.Embedif installation fails,Noneif the file was not found.