fix(timers): Remove user from last_seen on leave.
Fixes an issue where user inactivity was inaccurately tracked on rejoin.
This commit is contained in:
@@ -320,8 +320,6 @@ class TimerCog(LionCog):
|
|||||||
return
|
return
|
||||||
if member.bot:
|
if member.bot:
|
||||||
return
|
return
|
||||||
if 1148167212901859328 not in [role.id for role in member.roles]:
|
|
||||||
return
|
|
||||||
|
|
||||||
# If a member is leaving or joining a running timer, trigger a status update
|
# If a member is leaving or joining a running timer, trigger a status update
|
||||||
if before.channel != after.channel:
|
if before.channel != after.channel:
|
||||||
@@ -331,6 +329,7 @@ class TimerCog(LionCog):
|
|||||||
tasks = []
|
tasks = []
|
||||||
if leaving is not None:
|
if leaving is not None:
|
||||||
tasks.append(asyncio.create_task(leaving.update_status_card()))
|
tasks.append(asyncio.create_task(leaving.update_status_card()))
|
||||||
|
leaving.last_seen.pop(member.id, None)
|
||||||
if joining is not None:
|
if joining is not None:
|
||||||
joining.last_seen[member.id] = utc_now()
|
joining.last_seen[member.id] = utc_now()
|
||||||
if not joining.running and joining.auto_restart:
|
if not joining.running and joining.auto_restart:
|
||||||
|
|||||||
Reference in New Issue
Block a user