Fixes [p]trivia leaderboard not running. (#2983)

* Removes `MAX_BALANCE` from bank, user `bank.get_max_balance()` now
`[p]bankset maxbal` can be used to set the maximum bank balance

Signed-off-by: Guy <guyreis96@gmail.com>

* Adds `invoke_without_command` to `[p]trivial leaderboard`

Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
This commit is contained in:
Draper 2019-09-28 22:12:43 +01:00 committed by Michael H
parent 83483abfa5
commit f3b6c4cf32
2 changed files with 8 additions and 6 deletions

View File

@ -0,0 +1 @@
Fixes a bug where ``[p]trivia leaderboard`` failed to run.

View File

@ -267,14 +267,15 @@ class Trivia(commands.Cog):
else: else:
await ctx.send(msg) await ctx.send(msg)
@trivia.group(name="leaderboard", aliases=["lboard"], autohelp=False) @trivia.group(
name="leaderboard", aliases=["lboard"], autohelp=False, invoke_without_command=True
)
async def trivia_leaderboard(self, ctx: commands.Context): async def trivia_leaderboard(self, ctx: commands.Context):
"""Leaderboard for trivia. """Leaderboard for trivia.
Defaults to the top 10 of this server, sorted by total wins. Use Defaults to the top 10 of this server, sorted by total wins. Use
subcommands for a more customised leaderboard. subcommands for a more customised leaderboard.
""" """
if ctx.invoked_subcommand == self.trivia_leaderboard:
cmd = self.trivia_leaderboard_server cmd = self.trivia_leaderboard_server
if isinstance(ctx.channel, discord.abc.PrivateChannel): if isinstance(ctx.channel, discord.abc.PrivateChannel):
cmd = self.trivia_leaderboard_global cmd = self.trivia_leaderboard_global