mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
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:
parent
83483abfa5
commit
f3b6c4cf32
1
changelog.d/trivia/2911.bugfix.rst
Normal file
1
changelog.d/trivia/2911.bugfix.rst
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fixes a bug where ``[p]trivia leaderboard`` failed to run.
|
||||||
@ -267,18 +267,19 @@ 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
|
await ctx.invoke(cmd, "wins", 10)
|
||||||
await ctx.invoke(cmd, "wins", 10)
|
|
||||||
|
|
||||||
@trivia_leaderboard.command(name="server")
|
@trivia_leaderboard.command(name="server")
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user