mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Rework last leaderboards
This commit is contained in:
parent
062d54722b
commit
ca687956f6
2 changed files with 35 additions and 47 deletions
|
|
@ -21,10 +21,6 @@ class Leaderboard:
|
|||
colour: discord.Colour = discord.Colour.blue()
|
||||
fetch_names: bool = False
|
||||
|
||||
def __post_init__(self):
|
||||
if self.format_f is None:
|
||||
self .format_f = lambda x: x
|
||||
|
||||
def _should_highlight(self, data) -> bool:
|
||||
"""Check if an entry should be highlighted"""
|
||||
if self.fetch_names:
|
||||
|
|
@ -38,7 +34,9 @@ class Leaderboard:
|
|||
if self.fetch_names:
|
||||
name = get_display_name(self.ctx, int(data[0]))
|
||||
|
||||
s = f"{index + 1}: {name} ({self.format_f(data[1])})"
|
||||
formatted_data = self.format_f(data[2]) if self.format_f is not None else data[1]
|
||||
|
||||
s = f"{index + 1}: {name} ({formatted_data})"
|
||||
|
||||
return s
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue