fix (tasklist): Bound checks in task hook.
This commit is contained in:
@@ -151,7 +151,8 @@ class TasklistCog(LionCog):
|
|||||||
|
|
||||||
ecog = self.bot.get_cog('Economy')
|
ecog = self.bot.get_cog('Economy')
|
||||||
recent = await ecog.data.TaskTransaction.count_recent_for(member.id, member.guild.id) or 0
|
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]
|
to_reward = unrewarded[:max_to_reward]
|
||||||
|
|
||||||
count = len(to_reward)
|
count = len(to_reward)
|
||||||
|
|||||||
Reference in New Issue
Block a user