added the biggest_daddy function

This commit is contained in:
2021-08-10 23:13:09 -05:00
parent 2442d508cd
commit a5c1c1748a
2 changed files with 14 additions and 2 deletions

11
msg.py
View File

@@ -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(