From 1aa5a9b36c21621253887762b7532b364be7e8ed Mon Sep 17 00:00:00 2001 From: yuki Date: Thu, 9 Oct 2025 04:01:18 -0300 Subject: [PATCH] add top albums command --- commands/top.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/commands/top.py b/commands/top.py index 4ef330f..c36fa0b 100644 --- a/commands/top.py +++ b/commands/top.py @@ -58,7 +58,7 @@ def setup(bot: bot.Bot): top_list = user.get_top_artists(period=timeframe, limit=count, cacheable=False) for index, i in enumerate(top_list): msg_content += f"\n{index+1}. [{i.item.get_name(properly_capitalized=True)}]({i.item.get_url()}) | {i.weight} plays" - + case "album" | "track": top_list = user.get_top_albums(period=timeframe, limit=count) for index, i in top_list: @@ -82,7 +82,7 @@ def setup(bot: bot.Bot): return @bot.command(name="topartists", aliases=["ta","topartist"]) - @bot.slash_command(name="topartists", description="Generate a list of your top artists.") + @bot.slash_command(name="topartists", description="Generate a list of your most played artists.") async def topartists(ctx: nerimity.Context, timeframe: str = "7day", username: str = None, countstr: str = "10"): await send_top( ctx = ctx, @@ -91,3 +91,14 @@ def setup(bot: bot.Bot): username = username, countstr = countstr ) + + @bot.command(name="topalbums", aliases=["t","top","topalbum"]) + @bot.slash_command(name="topalbums", description="Generate a list of your most played albums.") + async def topalbums(ctx: nerimity.Context, timeframe: str = "7day", username: str = None, countstr: str = "10"): + await send_top( + ctx = ctx, + entity = "album", + timeframe = timeframe, + username = username, + countstr = countstr + )