@@ -1958,6 +1958,35 @@ async def user_ranking(
1958
1958
1959
1959
return content , rows , crown_holder , crown_playcount
1960
1960
1961
+ @commands .command ()
1962
+ @is_small_server ()
1963
+ @commands .guild_only ()
1964
+ async def crowns (self , ctx : MisoContext , * , user : discord .Member = None ):
1965
+ """See your current artist crowns on this server"""
1966
+ if user is None :
1967
+ user = ctx .author
1968
+
1969
+ crownartists = await self .bot .db .fetch (
1970
+ """
1971
+ SELECT artist_name, cached_playcount FROM artist_crown
1972
+ WHERE guild_id = %s AND user_id = %s ORDER BY cached_playcount DESC
1973
+ """ ,
1974
+ ctx .guild .id ,
1975
+ user .id ,
1976
+ )
1977
+ if not crownartists :
1978
+ return await ctx .send ("You don't have any crowns yet!" )
1979
+
1980
+ rows = [
1981
+ f"**{ escape_markdown (artist )} ** with **{ playcount } ** { play_s (playcount )} "
1982
+ for artist , playcount in crownartists
1983
+ ]
1984
+ content = discord .Embed (color = discord .Color .gold ())
1985
+ content .title = f"👑 { util .displayname (user , escape = False )} | Artist crowns"
1986
+ content .set_footer (text = f"Total { len (crownartists )} crowns" )
1987
+
1988
+ await RowPaginator (content , rows ).run (ctx )
1989
+
1961
1990
@commands .command (aliases = ["wk" , "whomstknows" ], usage = "<artist> 'np'" )
1962
1991
@commands .guild_only ()
1963
1992
@is_small_server ()
@@ -2329,7 +2358,7 @@ def parse_playcount(text: str):
2329
2358
2330
2359
2331
2360
def raise_no_artist_plays (artist : str , timeframe : Period ):
2332
- artist_escaped = discord . utils . escape_markdown (artist )
2361
+ artist_escaped = escape_markdown (artist )
2333
2362
raise exceptions .CommandInfo (
2334
2363
f"You have never listened to **{ artist_escaped } **!"
2335
2364
if timeframe == Period .OVERALL
0 commit comments