added the ability to filter with mentions

This commit is contained in:
jsl12
2022-05-11 23:39:18 -05:00
parent bd38d3e0e9
commit b17b6aff9a

View File

@@ -87,7 +87,8 @@ class Kwaylon(Client):
if days >= 1000: if days >= 1000:
await message.reply( await message.reply(
f'https://tenor.com/view/i-hate-you-anakin-darth-vader-vader-star-wars-gif-13071041') f'https://tenor.com/view/i-hate-you-anakin-darth-vader-vader-star-wars-gif-13071041'
)
return return
now = datetime.today().astimezone() now = datetime.today().astimezone()
@@ -105,6 +106,9 @@ class Kwaylon(Client):
await message.reply(res) await message.reply(res)
else: else:
if len(message.mentions) > 0:
df = df[df['auth_id'].isin([m.id for m in message.mentions])]
most = df.sort_values('count').iloc[-1] most = df.sort_values('count').iloc[-1]
msg = await self.fetch_message(most) msg = await self.fetch_message(most)
await message.reply(f'Most {emoji_ref} in past {days} days\n{msg.jump_url}') await message.reply(f'Most {emoji_ref} in past {days} days\n{msg.jump_url}')