aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joseph Banks <[email protected]>2018-10-07 21:10:40 +0000
committerGravatar Joseph Banks <[email protected]>2018-10-07 21:10:40 +0000
commit814685c94315f0d65957da4e3c2d45a3d8a29ead (patch)
treed02124fe32e78b734f5bcfeec85bd27017873899
parentMerge branch 'remind-command' into 'master' (diff)
parentAll command groups now invoke the help command. (diff)
Merge branch 'groups-help' into 'master'
All command groups now invoke the help command. See merge request python-discord/projects/bot!44
-rw-r--r--bot/cogs/bigbrother.py4
-rw-r--r--bot/cogs/cogs.py4
-rw-r--r--bot/cogs/defcon.py2
-rw-r--r--bot/cogs/deployment.py4
-rw-r--r--bot/cogs/eval.py2
-rw-r--r--bot/cogs/moderation.py8
-rw-r--r--bot/cogs/off_topic_names.py4
-rw-r--r--bot/cogs/snakes.py4
8 files changed, 24 insertions, 8 deletions
diff --git a/bot/cogs/bigbrother.py b/bot/cogs/bigbrother.py
index 9ea8efdb0..3f30eb0e9 100644
--- a/bot/cogs/bigbrother.py
+++ b/bot/cogs/bigbrother.py
@@ -79,11 +79,13 @@ class BigBrother:
await channel.send(relay_content)
- @group(name='bigbrother', aliases=('bb',))
+ @group(name='bigbrother', aliases=('bb',), invoke_without_command=True)
@with_role(Roles.owner, Roles.admin, Roles.moderator)
async def bigbrother_group(self, ctx: Context):
"""Monitor users, NSA-style."""
+ await ctx.invoke(self.bot.get_command("help"), "bigbrother")
+
@bigbrother_group.command(name='watched', aliases=('all',))
@with_role(Roles.owner, Roles.admin, Roles.moderator)
async def watched_command(self, ctx: Context, from_cache: bool = True):
diff --git a/bot/cogs/cogs.py b/bot/cogs/cogs.py
index 780850b5a..f090984dd 100644
--- a/bot/cogs/cogs.py
+++ b/bot/cogs/cogs.py
@@ -36,11 +36,13 @@ class Cogs:
# Allow reverse lookups by reversing the pairs
self.cogs.update({v: k for k, v in self.cogs.items()})
- @group(name='cogs', aliases=('c',))
+ @group(name='cogs', aliases=('c',), invoke_without_command=True)
@with_role(Roles.moderator, Roles.admin, Roles.owner, Roles.devops)
async def cogs_group(self, ctx: Context):
"""Load, unload, reload, and list active cogs."""
+ await ctx.invoke(self.bot.get_command("help"), "cogs")
+
@cogs_group.command(name='load', aliases=('l',))
@with_role(Roles.moderator, Roles.admin, Roles.owner, Roles.devops)
async def load_command(self, ctx: Context, cog: str):
diff --git a/bot/cogs/defcon.py b/bot/cogs/defcon.py
index beb05ba46..c432d377c 100644
--- a/bot/cogs/defcon.py
+++ b/bot/cogs/defcon.py
@@ -102,7 +102,7 @@ class Defcon:
async def defcon_group(self, ctx: Context):
"""Check the DEFCON status or run a subcommand."""
- await ctx.invoke(self.status_command)
+ await ctx.invoke(self.bot.get_command("help"), "defcon")
@defcon_group.command(name='enable', aliases=('on', 'e'))
@with_role(Roles.admin, Roles.owner)
diff --git a/bot/cogs/deployment.py b/bot/cogs/deployment.py
index 790af582b..bc9dbf5ab 100644
--- a/bot/cogs/deployment.py
+++ b/bot/cogs/deployment.py
@@ -17,11 +17,13 @@ class Deployment:
def __init__(self, bot: Bot):
self.bot = bot
- @group(name='redeploy')
+ @group(name='redeploy', invoke_without_command=True)
@with_role(Roles.owner, Roles.admin, Roles.moderator)
async def redeploy_group(self, ctx: Context):
"""Redeploy the bot or the site."""
+ await ctx.invoke(self.bot.get_command("help"), "redeploy")
+
@redeploy_group.command(name='bot')
@with_role(Roles.admin, Roles.owner, Roles.devops)
async def bot_command(self, ctx: Context):
diff --git a/bot/cogs/eval.py b/bot/cogs/eval.py
index 30e528efa..faecdf145 100644
--- a/bot/cogs/eval.py
+++ b/bot/cogs/eval.py
@@ -178,6 +178,8 @@ async def func(): # (None,) -> Any
async def internal_group(self, ctx):
"""Internal commands. Top secret!"""
+ await ctx.invoke(self.bot.get_command("help"), "internal")
+
@internal_group.command(name='eval', aliases=('e',))
@with_role(Roles.admin, Roles.owner)
async def eval(self, ctx, *, code: str):
diff --git a/bot/cogs/moderation.py b/bot/cogs/moderation.py
index 4a0e4c0f4..588962e29 100644
--- a/bot/cogs/moderation.py
+++ b/bot/cogs/moderation.py
@@ -489,15 +489,19 @@ class Moderation:
# region: Edit infraction commands
@with_role(*MODERATION_ROLES)
- @group(name='infraction', aliases=('infr', 'infractions', 'inf'))
+ @group(name='infraction', aliases=('infr', 'infractions', 'inf'), invoke_without_command=True)
async def infraction_group(self, ctx: Context):
"""Infraction manipulation commands."""
+ await ctx.invoke(self.bot.get_command("help"), "infraction")
+
@with_role(*MODERATION_ROLES)
- @infraction_group.group(name='edit')
+ @infraction_group.group(name='edit', invoke_without_command=True)
async def infraction_edit_group(self, ctx: Context):
"""Infraction editing commands."""
+ await ctx.invoke(self.bot.get_command("help"), "infraction", "edit")
+
@with_role(*MODERATION_ROLES)
@infraction_edit_group.command(name="duration")
async def edit_duration(self, ctx, infraction_id: str, duration: str):
diff --git a/bot/cogs/off_topic_names.py b/bot/cogs/off_topic_names.py
index ac2e1269c..25b8a48b8 100644
--- a/bot/cogs/off_topic_names.py
+++ b/bot/cogs/off_topic_names.py
@@ -86,11 +86,13 @@ class OffTopicNames:
coro = update_names(self.bot, self.headers)
self.updater_task = await self.bot.loop.create_task(coro)
- @group(name='otname', aliases=('otnames', 'otn'))
+ @group(name='otname', aliases=('otnames', 'otn'), invoke_without_command=True)
@with_role(Roles.owner, Roles.admin, Roles.moderator)
async def otname_group(self, ctx):
"""Add or list items from the off-topic channel name rotation."""
+ await ctx.invoke(self.bot.get_command("help"), "otname")
+
@otname_group.command(name='add', aliases=('a',))
@with_role(Roles.owner, Roles.admin, Roles.moderator)
async def add_command(self, ctx, name: OffTopicName):
diff --git a/bot/cogs/snakes.py b/bot/cogs/snakes.py
index f83f8e354..d74380259 100644
--- a/bot/cogs/snakes.py
+++ b/bot/cogs/snakes.py
@@ -462,10 +462,12 @@ class Snakes:
# endregion
# region: Commands
- @group(name='snakes', aliases=('snake',))
+ @group(name='snakes', aliases=('snake',), invoke_without_command=True)
async def snakes_group(self, ctx: Context):
"""Commands from our first code jam."""
+ await ctx.invoke(self.bot.get_command("help"), "snake")
+
@bot_has_permissions(manage_messages=True)
@snakes_group.command(name='antidote')
@locked()