added the biggest_daddy function
This commit is contained in:
11
msg.py
11
msg.py
@@ -127,6 +127,17 @@ class MsgData:
|
||||
|
||||
return res
|
||||
|
||||
def biggest_daddy(self, days, top: int = None):
|
||||
df = self.emoji_totals('daddy', days)
|
||||
if top is not None:
|
||||
df = df.iloc[:top]
|
||||
width = max(list(map(lambda s: len(str(s)), df.index.values)))
|
||||
res = f'Daddy totals, past {days} days\n'
|
||||
res += '\n'.join(
|
||||
f"`{name.ljust(width + 1)}with {row['total']:<2.0f} total`"
|
||||
for name, row in df.iterrows()
|
||||
)
|
||||
return res
|
||||
|
||||
async def message_df(client: discord.Client, **kwargs):
|
||||
return pd.DataFrame(
|
||||
|
||||
Reference in New Issue
Block a user