[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

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