add top albums command
This commit is contained in:
parent
f45d91d0c0
commit
1aa5a9b36c
1 changed files with 13 additions and 2 deletions
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue