Rename leaderboard command to globalboard for clarity and consistency. Update related command references and help messages to reflect the new naming convention, enhancing user experience when accessing global leaderboard features.
Some checks are pending
Run pre-commit / Run pre-commit (push) Waiting to run

This commit is contained in:
Valerie 2025-05-26 03:54:34 -04:00
parent 5cd5f49fe6
commit 899bfc7bc0

View file

@ -92,13 +92,13 @@ class Leaderboard(commands.Cog):
log.error(f"Error updating points: {e}") log.error(f"Error updating points: {e}")
return False return False
@commands.group(name="leaderboard", aliases=["lb"]) @commands.group(name="globalboard", aliases=["glb"])
async def leaderboard(self, ctx: commands.Context): async def globalboard(self, ctx: commands.Context):
"""Leaderboard commands.""" """Global leaderboard commands."""
if ctx.invoked_subcommand is None: if ctx.invoked_subcommand is None:
await ctx.send_help(ctx.command) await ctx.send_help(ctx.command)
@leaderboard.command(name="show") @globalboard.command(name="show")
async def show_leaderboard(self, ctx: commands.Context, page: int = 1): async def show_leaderboard(self, ctx: commands.Context, page: int = 1):
"""Show the global leaderboard.""" """Show the global leaderboard."""
async with ctx.typing(): async with ctx.typing():
@ -126,12 +126,12 @@ class Leaderboard(commands.Cog):
lines.append(f"{i}. {username}: {points:,} points") lines.append(f"{i}. {username}: {points:,} points")
header = f"🏆 Global Leaderboard (Page {page}/{len(pages)})" header = f"🏆 Global Leaderboard (Page {page}/{len(pages)})"
footer = f"Use {ctx.prefix}leaderboard show <page> to view other pages" footer = f"Use {ctx.prefix}globalboard show <page> to view other pages"
content = box("\n".join([header, *lines, "", footer]), lang="md") content = box("\n".join([header, *lines, "", footer]), lang="md")
await ctx.send(content) await ctx.send(content)
@leaderboard.command(name="points") @globalboard.command(name="points")
async def check_points(self, ctx: commands.Context, member: commands.MemberConverter = None): async def check_points(self, ctx: commands.Context, member: commands.MemberConverter = None):
"""Check your points or another member's points.""" """Check your points or another member's points."""
member = member or ctx.author member = member or ctx.author