"cog packages" for loads

This commit is contained in:
bobloy
2020-11-30 12:21:30 -05:00
parent 6dd9c05571
commit 0bd77f5021

View File

@@ -989,8 +989,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
async def mydata_user_deletion_by_owner(self, ctx, user_id: int): async def mydata_user_deletion_by_owner(self, ctx, user_id: int):
"""Delete data [botname] has about a user. """Delete data [botname] has about a user.
This will cause the bot to get rid of or disassociate a lot of data about the specified user. This will cause the bot to get rid of or disassociate a lot of data about the specified
This may include more than just end user data, including anti abuse records. user. This may include more than just end user data, including anti abuse records.
**Arguments:** **Arguments:**
@@ -1062,8 +1062,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
""" """
Commands for toggling embeds on or off. Commands for toggling embeds on or off.
This setting determines whether or not to use embeds as a response to a command (for commands that support it). This setting determines whether or not to use embeds as a response to a command (for
The default is to use embeds. commands that support it). The default is to use embeds.
""" """
@embedset.command(name="showsettings") @embedset.command(name="showsettings")
@@ -1378,17 +1378,19 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
@commands.command() @commands.command()
@checks.is_owner() @checks.is_owner()
async def load(self, ctx: commands.Context, *cogs: str): async def load(self, ctx: commands.Context, *cogs: str):
"""Loads packages from the local paths and installed cogs. """Loads cog packages from the local paths and installed cogs.
See packages available to load with `[p]cogs`. See packages available to load with `[p]cogs`.
Additional cogs can be added using Downloader, or from local paths using `[p]addpath`.
Examples: Examples:
- `[p]load general` - Loads the `general` cog. - `[p]load general` - Loads the `general` cog.
- `[p]load admin mod mutes` - Loads multiple cogs. - `[p]load admin mod mutes` - Loads multiple cogs.
**Arguments:** **Arguments:**
- `[cogs...]` Required to set to public. Not required to toggle back to private. - `[cogs...]` The cog packages to load.
""" """
if not cogs: if not cogs:
return await ctx.send_help() return await ctx.send_help()
@@ -1500,17 +1502,18 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
@commands.command() @commands.command()
@checks.is_owner() @checks.is_owner()
async def unload(self, ctx: commands.Context, *cogs: str): async def unload(self, ctx: commands.Context, *cogs: str):
"""Unloads packages. """Unloads previously loaded cog packages.
See packages available to unload with `[p]cogs`. See packages available to unload with `[p]cogs`.
Examples: Examples:
- `[p]load general` - Loads the `general` cog. - `[p]unload general` - Unloads the `general` cog.
- `[p]load admin mod mutes` - Loads multiple cogs. - `[p]unload admin mod mutes` - Unloads multiple cogs.
**Arguments:** **Arguments:**
- `[cogs...]` Required to set to public. Not required to toggle back to private.""" - `[cogs...]` The cog packages to unload.
"""
if not cogs: if not cogs:
return await ctx.send_help() return await ctx.send_help()
cogs = tuple(map(lambda cog: cog.rstrip(","), cogs)) cogs = tuple(map(lambda cog: cog.rstrip(","), cogs))
@@ -1548,7 +1551,20 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
@commands.command(name="reload") @commands.command(name="reload")
@checks.is_owner() @checks.is_owner()
async def reload(self, ctx: commands.Context, *cogs: str): async def reload(self, ctx: commands.Context, *cogs: str):
"""Reloads packages.""" """Reloads cog packages.
This will unload and then load the specified cogs.
Cogs that were not loaded will be loaded.
Examples:
- `[p]reload general` - Unloads then loads the `general` cog.
- `[p]reload admin mod mutes` - Unloads then loads multiple cogs.
**Arguments:**
- `[cogs...]` The cog packages to unload.
"""
if not cogs: if not cogs:
return await ctx.send_help() return await ctx.send_help()
cogs = tuple(map(lambda cog: cog.rstrip(","), cogs)) cogs = tuple(map(lambda cog: cog.rstrip(","), cogs))