[V3] Custom context class (#988)

* Create custom context class

* Documentation

* Remove old help method, replace with new

* Update from rebase
This commit is contained in:
Tobotimus
2017-10-16 12:02:51 +11:00
committed by Will
parent 36b3fbd5bc
commit 86b18c702c
14 changed files with 78 additions and 32 deletions

View File

@@ -136,7 +136,7 @@ class Core:
async def _set(self, ctx):
"""Changes Red's settings"""
if ctx.invoked_subcommand is None:
await ctx.bot.send_cmd_help(ctx)
await ctx.send_help()
@_set.command()
@checks.guildowner()
@@ -207,7 +207,7 @@ class Core:
try:
status = statuses[status.lower()]
except KeyError:
await ctx.bot.send_cmd_help(ctx)
await ctx.send_help()
else:
await ctx.bot.change_presence(status=status,
game=game)
@@ -229,7 +229,7 @@ class Core:
game = discord.Game(type=1, url=streamer, name=stream_title)
await ctx.bot.change_presence(game=game, status=status)
elif streamer is not None:
await ctx.bot.send_cmd_help(ctx)
await ctx.send_help()
return
else:
await ctx.bot.change_presence(game=None, status=status)
@@ -267,7 +267,7 @@ class Core:
async def prefix(self, ctx, *prefixes):
"""Sets Red's global prefix(es)"""
if not prefixes:
await ctx.bot.send_cmd_help(ctx)
await ctx.send_help()
return
prefixes = sorted(prefixes, reverse=True)
await ctx.bot.db.prefix.set(prefixes)