[V3 Core] Command group automatic help (#1790)

* decorator inheritence

* black format

* add autohelp

* modify commands to use autohelp
This commit is contained in:
Michael H 2018-06-08 20:54:36 -04:00 committed by Will
parent ca19ecaefc
commit 17c7dd658d
19 changed files with 87 additions and 104 deletions

View File

@ -157,13 +157,12 @@ class Admin:
else: else:
await self.complain(ctx, USER_HIERARCHY_ISSUE) await self.complain(ctx, USER_HIERARCHY_ISSUE)
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.admin_or_permissions(manage_roles=True) @checks.admin_or_permissions(manage_roles=True)
async def editrole(self, ctx: commands.Context): async def editrole(self, ctx: commands.Context):
"""Edits roles settings""" """Edits roles settings"""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@editrole.command(name="colour", aliases=["color"]) @editrole.command(name="colour", aliases=["color"])
async def editrole_colour( async def editrole_colour(

View File

@ -170,20 +170,18 @@ class Alias:
new_message.content = "{}{} {}".format(prefix, alias.command, args) new_message.content = "{}{} {}".format(prefix, alias.command, args)
await self.bot.process_commands(new_message) await self.bot.process_commands(new_message)
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
async def alias(self, ctx: commands.Context): async def alias(self, ctx: commands.Context):
"""Manage per-server aliases for commands""" """Manage per-server aliases for commands"""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@alias.group(name="global") @alias.group(name="global", autohelp=True)
async def global_(self, ctx: commands.Context): async def global_(self, ctx: commands.Context):
""" """
Manage global aliases. Manage global aliases.
""" """
if ctx.invoked_subcommand is None or isinstance(ctx.invoked_subcommand, commands.Group): pass
await ctx.send_help()
@checks.mod_or_permissions(manage_guild=True) @checks.mod_or_permissions(manage_guild=True)
@alias.command(name="add") @alias.command(name="add")

View File

@ -163,12 +163,11 @@ class Audio:
await message_channel.send(embed=embed) await message_channel.send(embed=embed)
await player.skip() await player.skip()
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
async def audioset(self, ctx): async def audioset(self, ctx):
"""Music configuration options.""" """Music configuration options."""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@audioset.command() @audioset.command()
@checks.admin_or_permissions(manage_roles=True) @checks.admin_or_permissions(manage_roles=True)
@ -631,12 +630,11 @@ class Audio:
await player.play() await player.play()
await ctx.send(embed=embed) await ctx.send(embed=embed)
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
async def playlist(self, ctx): async def playlist(self, ctx):
"""Playlist configuration options.""" """Playlist configuration options."""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@playlist.command(name="append") @playlist.command(name="append")
async def _playlist_append(self, ctx, playlist_name, *url): async def _playlist_append(self, ctx, playlist_name, *url):
@ -1593,13 +1591,12 @@ class Audio:
embed.set_footer(text="Nothing playing.") embed.set_footer(text="Nothing playing.")
await ctx.send(embed=embed) await ctx.send(embed=embed)
@commands.group(aliases=["llset"]) @commands.group(aliases=["llset"], autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.is_owner() @checks.is_owner()
async def llsetup(self, ctx): async def llsetup(self, ctx):
"""Lavalink server configuration options.""" """Lavalink server configuration options."""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@llsetup.command() @llsetup.command()
async def external(self, ctx): async def external(self, ctx):

View File

@ -58,7 +58,7 @@ class Bank:
# SECTION commands # SECTION commands
@commands.group() @commands.group(autohelp=True)
@checks.guildowner_or_permissions(administrator=True) @checks.guildowner_or_permissions(administrator=True)
async def bankset(self, ctx: commands.Context): async def bankset(self, ctx: commands.Context):
"""Base command for bank settings""" """Base command for bank settings"""
@ -69,7 +69,6 @@ class Bank:
default_balance = await bank._conf.default_balance() default_balance = await bank._conf.default_balance()
else: else:
if not ctx.guild: if not ctx.guild:
await ctx.send_help()
return return
bank_name = await bank._conf.guild(ctx.guild).bank_name() bank_name = await bank._conf.guild(ctx.guild).bank_name()
currency_name = await bank._conf.guild(ctx.guild).currency() currency_name = await bank._conf.guild(ctx.guild).currency()
@ -79,7 +78,6 @@ class Bank:
"Bank settings:\n\nBank name: {}\nCurrency: {}\nDefault balance: {}" "Bank settings:\n\nBank name: {}\nCurrency: {}\nDefault balance: {}"
).format(bank_name, currency_name, default_balance) ).format(bank_name, currency_name, default_balance)
await ctx.send(box(settings)) await ctx.send(box(settings))
await ctx.send_help()
@bankset.command(name="toggleglobal") @bankset.command(name="toggleglobal")
@checks.is_owner() @checks.is_owner()

View File

@ -92,12 +92,11 @@ class Cleanup:
before = message before = message
return to_delete return to_delete
@commands.group() @commands.group(autohelp=True)
@checks.mod_or_permissions(manage_messages=True) @checks.mod_or_permissions(manage_messages=True)
async def cleanup(self, ctx: commands.Context): async def cleanup(self, ctx: commands.Context):
"""Deletes messages.""" """Deletes messages."""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@cleanup.command() @cleanup.command()
@commands.guild_only() @commands.guild_only()

View File

@ -141,14 +141,13 @@ class CustomCommands:
self.config.register_guild(commands={}) self.config.register_guild(commands={})
self.commandobj = CommandObj(config=self.config, bot=self.bot) self.commandobj = CommandObj(config=self.config, bot=self.bot)
@commands.group(aliases=["cc"], no_pm=True) @commands.group(aliases=["cc"], autohelp=True)
@commands.guild_only() @commands.guild_only()
async def customcom(self, ctx: commands.Context): async def customcom(self, ctx: commands.Context):
"""Custom commands management""" """Custom commands management"""
if not ctx.invoked_subcommand: pass
await ctx.send_help()
@customcom.group(name="add") @customcom.group(name="add", autohelp=True)
@checks.mod_or_permissions(administrator=True) @checks.mod_or_permissions(administrator=True)
async def cc_add(self, ctx: commands.Context): async def cc_add(self, ctx: commands.Context):
""" """
@ -166,8 +165,7 @@ class CustomCommands:
{server} message.guild {server} message.guild
""" """
if not ctx.invoked_subcommand or isinstance(ctx.invoked_subcommand, commands.Group): pass
await ctx.send_help()
@cc_add.command(name="random") @cc_add.command(name="random")
@checks.mod_or_permissions(administrator=True) @checks.mod_or_permissions(administrator=True)

View File

@ -204,14 +204,13 @@ class Downloader:
) )
) )
@commands.group() @commands.group(autohelp=True)
@checks.is_owner() @checks.is_owner()
async def repo(self, ctx): async def repo(self, ctx):
""" """
Command group for managing Downloader repos. Command group for managing Downloader repos.
""" """
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@repo.command(name="add") @repo.command(name="add")
async def _repo_add(self, ctx, name: str, repo_url: str, branch: str = None): async def _repo_add(self, ctx, name: str, repo_url: str, branch: str = None):
@ -273,14 +272,13 @@ class Downloader:
msg = _("Information on {}:\n{}").format(repo_name.name, repo_name.description or "") msg = _("Information on {}:\n{}").format(repo_name.name, repo_name.description or "")
await ctx.send(box(msg)) await ctx.send(box(msg))
@commands.group() @commands.group(autohelp=True)
@checks.is_owner() @checks.is_owner()
async def cog(self, ctx): async def cog(self, ctx):
""" """
Command group for managing installable Cogs. Command group for managing installable Cogs.
""" """
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@cog.command(name="install") @cog.command(name="install")
async def _cog_install(self, ctx, repo_name: Repo, cog_name: str): async def _cog_install(self, ctx, repo_name: Repo, cog_name: str):

View File

@ -137,11 +137,10 @@ class Economy:
self.config.register_role(**self.default_role_settings) self.config.register_role(**self.default_role_settings)
self.slot_register = defaultdict(dict) self.slot_register = defaultdict(dict)
@commands.group(name="bank") @commands.group(name="bank", autohelp=True)
async def _bank(self, ctx: commands.Context): async def _bank(self, ctx: commands.Context):
"""Bank operations""" """Bank operations"""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@_bank.command() @_bank.command()
async def balance(self, ctx: commands.Context, user: discord.Member = None): async def balance(self, ctx: commands.Context, user: discord.Member = None):
@ -439,14 +438,13 @@ class Economy:
) )
) )
@commands.group() @commands.group(autohelp=True)
@guild_only_check() @guild_only_check()
@check_global_setting_admin() @check_global_setting_admin()
async def economyset(self, ctx: commands.Context): async def economyset(self, ctx: commands.Context):
"""Changes economy module settings""" """Changes economy module settings"""
guild = ctx.guild guild = ctx.guild
if ctx.invoked_subcommand is None: if ctx.invoked_subcommand is None:
await ctx.send_help()
if await bank.is_global(): if await bank.is_global():
slot_min = await self.config.SLOT_MIN() slot_min = await self.config.SLOT_MIN()
slot_max = await self.config.SLOT_MAX() slot_max = await self.config.SLOT_MAX()

View File

@ -39,7 +39,7 @@ class Filter:
except RuntimeError: except RuntimeError:
pass pass
@commands.group(name="filter") @commands.group(name="filter", autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.mod_or_permissions(manage_messages=True) @checks.mod_or_permissions(manage_messages=True)
async def _filter(self, ctx: commands.Context): async def _filter(self, ctx: commands.Context):
@ -49,7 +49,6 @@ class Filter:
Using this command with no subcommands will send Using this command with no subcommands will send
the list of the server's filtered words.""" the list of the server's filtered words."""
if ctx.invoked_subcommand is None: if ctx.invoked_subcommand is None:
await ctx.send_help()
server = ctx.guild server = ctx.guild
author = ctx.author author = ctx.author
word_list = await self.settings.guild(server).filter() word_list = await self.settings.guild(server).filter()

View File

@ -26,14 +26,13 @@ class Image:
def __unload(self): def __unload(self):
self.session.close() self.session.close()
@commands.group(name="imgur") @commands.group(name="imgur", autohelp=True)
async def _imgur(self, ctx): async def _imgur(self, ctx):
"""Retrieves pictures from imgur """Retrieves pictures from imgur
Make sure to set the client ID using Make sure to set the client ID using
[p]imgurcreds""" [p]imgurcreds"""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@_imgur.command(name="search") @_imgur.command(name="search")
async def imgur_search(self, ctx, *, term: str): async def imgur_search(self, ctx, *, term: str):

View File

@ -161,14 +161,12 @@ class Mod:
except RuntimeError: except RuntimeError:
pass pass
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.guildowner_or_permissions(administrator=True) @checks.guildowner_or_permissions(administrator=True)
async def modset(self, ctx: commands.Context): async def modset(self, ctx: commands.Context):
"""Manages server administration settings.""" """Manages server administration settings."""
if ctx.invoked_subcommand is None: if ctx.invoked_subcommand is None:
guild = ctx.guild
await ctx.send_help()
# Display current settings # Display current settings
delete_repeats = await self.settings.guild(guild).delete_repeats() delete_repeats = await self.settings.guild(guild).delete_repeats()
@ -834,13 +832,12 @@ class Mod:
_("I cannot do that, I lack the '{}' permission.").format("Manage Nicknames") _("I cannot do that, I lack the '{}' permission.").format("Manage Nicknames")
) )
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.mod_or_permissions(manage_channel=True) @checks.mod_or_permissions(manage_channel=True)
async def mute(self, ctx: commands.Context): async def mute(self, ctx: commands.Context):
"""Mutes user in the channel/server""" """Mutes user in the channel/server"""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@mute.command(name="voice") @mute.command(name="voice")
@commands.guild_only() @commands.guild_only()
@ -1001,15 +998,14 @@ class Mod:
await self.settings.member(user).perms_cache.set(perms_cache) await self.settings.member(user).perms_cache.set(perms_cache)
return True, None return True, None
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.mod_or_permissions(manage_channel=True) @checks.mod_or_permissions(manage_channel=True)
async def unmute(self, ctx: commands.Context): async def unmute(self, ctx: commands.Context):
"""Unmutes user in the channel/server """Unmutes user in the channel/server
Defaults to channel""" Defaults to channel"""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@unmute.command(name="voice") @unmute.command(name="voice")
@commands.guild_only() @commands.guild_only()
@ -1168,7 +1164,7 @@ class Mod:
await self.settings.member(user).perms_cache.set(perms_cache) await self.settings.member(user).perms_cache.set(perms_cache)
return True, None return True, None
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.admin_or_permissions(manage_channels=True) @checks.admin_or_permissions(manage_channels=True)
async def ignore(self, ctx: commands.Context): async def ignore(self, ctx: commands.Context):
@ -1201,13 +1197,12 @@ class Mod:
else: else:
await ctx.send(_("This server is already being ignored.")) await ctx.send(_("This server is already being ignored."))
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.admin_or_permissions(manage_channels=True) @checks.admin_or_permissions(manage_channels=True)
async def unignore(self, ctx: commands.Context): async def unignore(self, ctx: commands.Context):
"""Removes servers/channels from ignorelist""" """Removes servers/channels from ignorelist"""
if ctx.invoked_subcommand is None: if ctx.invoked_subcommand is None:
await ctx.send_help()
await ctx.send(await self.count_ignored()) await ctx.send(await self.count_ignored())
@unignore.command(name="channel") @unignore.command(name="channel")

View File

@ -15,12 +15,11 @@ class ModLog:
def __init__(self, bot: Red): def __init__(self, bot: Red):
self.bot = bot self.bot = bot
@commands.group() @commands.group(autohelp=True)
@checks.guildowner_or_permissions(administrator=True) @checks.guildowner_or_permissions(administrator=True)
async def modlogset(self, ctx: commands.Context): async def modlogset(self, ctx: commands.Context):
"""Settings for the mod log""" """Settings for the mod log"""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@modlogset.command() @modlogset.command()
@commands.guild_only() @commands.guild_only()

View File

@ -125,13 +125,12 @@ class Permissions:
# async def admin_model(self, ctx: commands.Context) -> bool: # async def admin_model(self, ctx: commands.Context) -> bool:
# async def mod_model(self, ctx: commands.Context) -> bool: # async def mod_model(self, ctx: commands.Context) -> bool:
@commands.group(aliases=["p"]) @commands.group(aliases=["p"], autohelp=True)
async def permissions(self, ctx: commands.Context): async def permissions(self, ctx: commands.Context):
""" """
Permission management tools Permission management tools
""" """
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@permissions.command() @permissions.command()
async def explain(self, ctx: commands.Context): async def explain(self, ctx: commands.Context):

View File

@ -56,7 +56,7 @@ class Reports:
@checks.admin_or_permissions(manage_guild=True) @checks.admin_or_permissions(manage_guild=True)
@commands.guild_only() @commands.guild_only()
@commands.group(name="reportset") @commands.group(name="reportset", autohelp=True)
async def reportset(self, ctx: commands.Context): async def reportset(self, ctx: commands.Context):
""" """
settings for reports settings for reports

View File

@ -130,18 +130,16 @@ class Streams:
else: else:
await ctx.send(embed=embed) await ctx.send(embed=embed)
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.mod() @checks.mod()
async def streamalert(self, ctx: commands.Context): async def streamalert(self, ctx: commands.Context):
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@streamalert.group(name="twitch") @streamalert.group(name="twitch", autohelp=True)
async def _twitch(self, ctx: commands.Context): async def _twitch(self, ctx: commands.Context):
"""Twitch stream alerts""" """Twitch stream alerts"""
if ctx.invoked_subcommand is None or ctx.invoked_subcommand == self._twitch: pass
await ctx.send_help()
@_twitch.command(name="channel") @_twitch.command(name="channel")
async def twitch_alert_channel(self, ctx: commands.Context, channel_name: str): async def twitch_alert_channel(self, ctx: commands.Context, channel_name: str):
@ -291,11 +289,10 @@ class Streams:
await self.add_or_remove_community(ctx, community) await self.add_or_remove_community(ctx, community)
@commands.group() @commands.group(autohelp=True)
@checks.mod() @checks.mod()
async def streamset(self, ctx: commands.Context): async def streamset(self, ctx: commands.Context):
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@streamset.command() @streamset.command()
@checks.is_owner() @checks.is_owner()
@ -331,12 +328,11 @@ class Streams:
await self.db.tokens.set_raw("YoutubeStream", value=key) await self.db.tokens.set_raw("YoutubeStream", value=key)
await ctx.send(_("Youtube key set.")) await ctx.send(_("Youtube key set."))
@streamset.group() @streamset.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
async def mention(self, ctx: commands.Context): async def mention(self, ctx: commands.Context):
"""Sets mentions for stream alerts.""" """Sets mentions for stream alerts."""
if ctx.invoked_subcommand is None or ctx.invoked_subcommand == self.mention: pass
await ctx.send_help()
@mention.command(aliases=["everyone"]) @mention.command(aliases=["everyone"])
@commands.guild_only() @commands.guild_only()

View File

@ -41,13 +41,12 @@ class Trivia:
self.conf.register_member(wins=0, games=0, total_score=0) self.conf.register_member(wins=0, games=0, total_score=0)
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.mod_or_permissions(administrator=True) @checks.mod_or_permissions(administrator=True)
async def triviaset(self, ctx: commands.Context): async def triviaset(self, ctx: commands.Context):
"""Manage trivia settings.""" """Manage trivia settings."""
if ctx.invoked_subcommand is None: if ctx.invoked_subcommand is None:
await ctx.send_help()
settings = self.conf.guild(ctx.guild) settings = self.conf.guild(ctx.guild)
settings_dict = await settings.all() settings_dict = await settings.all()
msg = box( msg = box(
@ -252,7 +251,7 @@ class Trivia:
return return
await ctx.send(msg) await ctx.send(msg)
@trivia.group(name="leaderboard", aliases=["lboard"]) @trivia.group(name="leaderboard", aliases=["lboard"], autohelp=False)
async def trivia_leaderboard(self, ctx: commands.Context): async def trivia_leaderboard(self, ctx: commands.Context):
"""Leaderboard for trivia. """Leaderboard for trivia.

View File

@ -41,13 +41,12 @@ class Warnings:
except RuntimeError: except RuntimeError:
pass pass
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.guildowner_or_permissions(administrator=True) @checks.guildowner_or_permissions(administrator=True)
async def warningset(self, ctx: commands.Context): async def warningset(self, ctx: commands.Context):
"""Warning settings""" """Warning settings"""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@warningset.command() @warningset.command()
@commands.guild_only() @commands.guild_only()
@ -59,13 +58,12 @@ class Warnings:
_("Custom reasons have been {}.").format(_("enabled") if allowed else _("disabled")) _("Custom reasons have been {}.").format(_("enabled") if allowed else _("disabled"))
) )
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.guildowner_or_permissions(administrator=True) @checks.guildowner_or_permissions(administrator=True)
async def warnaction(self, ctx: commands.Context): async def warnaction(self, ctx: commands.Context):
"""Action management""" """Action management"""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@warnaction.command(name="add") @warnaction.command(name="add")
@commands.guild_only() @commands.guild_only()
@ -136,13 +134,12 @@ class Warnings:
else: else:
await ctx.send(_("No action named {} exists!").format(action_name)) await ctx.send(_("No action named {} exists!").format(action_name))
@commands.group() @commands.group(autohelp=True)
@commands.guild_only() @commands.guild_only()
@checks.guildowner_or_permissions(administrator=True) @checks.guildowner_or_permissions(administrator=True)
async def warnreason(self, ctx: commands.Context): async def warnreason(self, ctx: commands.Context):
"""Add reasons for warnings""" """Add reasons for warnings"""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@warnreason.command(name="add") @warnreason.command(name="add")
@commands.guild_only() @commands.guild_only()

View File

@ -97,7 +97,27 @@ class Group(Command, commands.Group):
in. in.
""" """
pass def __init__(self, *args, **kwargs):
self.autohelp = kwargs.pop("autohelp", False)
super().__init__(*args, **kwargs)
async def invoke(self, ctx):
view = ctx.view
previous = view.index
view.skip_ws()
trigger = view.get_word()
if trigger:
ctx.subcommand_passed = trigger
ctx.invoked_subcommand = self.all_commands.get(trigger, None)
view.index = previous
view.previous = previous
if ctx.invoked_subcommand is None or self == ctx.invoked_subcommand:
if self.autohelp and not self.invoke_without_command:
await ctx.send_help()
await super().invoke(ctx)
# decorators # decorators

View File

@ -321,7 +321,7 @@ class Core(CoreLogic):
return fmt.format(d=days, h=hours, m=minutes, s=seconds) return fmt.format(d=days, h=hours, m=minutes, s=seconds)
@commands.group() @commands.group(autohelp=True)
async def embedset(self, ctx: commands.Context): async def embedset(self, ctx: commands.Context):
""" """
Commands for toggling embeds on or off. Commands for toggling embeds on or off.
@ -341,7 +341,6 @@ class Core(CoreLogic):
user_setting = await self.bot.db.user(ctx.author).embeds() user_setting = await self.bot.db.user(ctx.author).embeds()
text += "User setting: {}".format(user_setting) text += "User setting: {}".format(user_setting)
await ctx.send(box(text)) await ctx.send(box(text))
await ctx.send_help()
@embedset.command(name="global") @embedset.command(name="global")
@checks.is_owner() @checks.is_owner()
@ -528,7 +527,7 @@ class Core(CoreLogic):
formed = self._get_package_strings(not_found, fmt, ("was", "were")) formed = self._get_package_strings(not_found, fmt, ("was", "were"))
await ctx.send(formed) await ctx.send(formed)
@commands.group() @commands.command()
@checks.is_owner() @checks.is_owner()
async def unload(self, ctx, *, cog_name: str): async def unload(self, ctx, *, cog_name: str):
"""Unloads packages""" """Unloads packages"""
@ -599,7 +598,7 @@ class Core(CoreLogic):
pass pass
await ctx.bot.shutdown(restart=True) await ctx.bot.shutdown(restart=True)
@commands.group(name="set") @commands.group(name="set", autohelp=True)
async def _set(self, ctx): async def _set(self, ctx):
"""Changes Red's settings""" """Changes Red's settings"""
if ctx.invoked_subcommand is None: if ctx.invoked_subcommand is None:
@ -625,7 +624,6 @@ class Core(CoreLogic):
f"Locale: {locale}" f"Locale: {locale}"
) )
await ctx.send(box(settings)) await ctx.send(box(settings))
await ctx.send_help()
@_set.command() @_set.command()
@checks.guildowner() @checks.guildowner()
@ -983,12 +981,11 @@ class Core(CoreLogic):
ctx.bot.disable_sentry() ctx.bot.disable_sentry()
await ctx.send(_("Done. Sentry logging is now disabled.")) await ctx.send(_("Done. Sentry logging is now disabled."))
@commands.group() @commands.group(autohelp=True)
@checks.is_owner() @checks.is_owner()
async def helpset(self, ctx: commands.Context): async def helpset(self, ctx: commands.Context):
"""Manage settings for the help command.""" """Manage settings for the help command."""
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@helpset.command(name="pagecharlimit") @helpset.command(name="pagecharlimit")
async def helpset_pagecharlimt(self, ctx: commands.Context, limit: int): async def helpset_pagecharlimt(self, ctx: commands.Context, limit: int):
@ -1269,14 +1266,13 @@ class Core(CoreLogic):
else: else:
await ctx.send(_("Message delivered to {}").format(destination)) await ctx.send(_("Message delivered to {}").format(destination))
@commands.group() @commands.group(autohelp=True)
@checks.is_owner() @checks.is_owner()
async def whitelist(self, ctx): async def whitelist(self, ctx):
""" """
Whitelist management commands. Whitelist management commands.
""" """
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@whitelist.command(name="add") @whitelist.command(name="add")
async def whitelist_add(self, ctx, user: discord.User): async def whitelist_add(self, ctx, user: discord.User):
@ -1328,14 +1324,13 @@ class Core(CoreLogic):
await ctx.bot.db.whitelist.set([]) await ctx.bot.db.whitelist.set([])
await ctx.send(_("Whitelist has been cleared.")) await ctx.send(_("Whitelist has been cleared."))
@commands.group() @commands.group(autohelp=True)
@checks.is_owner() @checks.is_owner()
async def blacklist(self, ctx): async def blacklist(self, ctx):
""" """
blacklist management commands. blacklist management commands.
""" """
if ctx.invoked_subcommand is None: pass
await ctx.send_help()
@blacklist.command(name="add") @blacklist.command(name="add")
async def blacklist_add(self, ctx, user: discord.User): async def blacklist_add(self, ctx, user: discord.User):