fix (tasklist): Bound checks in task hook.

This commit is contained in:
2023-06-09 05:17:38 +03:00
parent 14543d975c
commit 7c039dd0da

View File

@@ -151,7 +151,8 @@ class TasklistCog(LionCog):
ecog = self.bot.get_cog('Economy')
recent = await ecog.data.TaskTransaction.count_recent_for(member.id, member.guild.id) or 0
max_to_reward = max(limit-recent, 0)
max_to_reward = limit - recent
if max_to_reward > 0:
to_reward = unrewarded[:max_to_reward]
count = len(to_reward)