refactor: minor fixes everywhere

This commit is contained in:
2025-01-05 23:43:08 -05:00
parent ebde4f1310
commit 565dbb6f47
11 changed files with 44 additions and 47 deletions

View File

@@ -3,7 +3,7 @@ import time
import disnake
from state import client, last_used, players
from state import client, idle_tracker, players
async def cleanup():
@@ -17,12 +17,9 @@ async def cleanup():
for target in targets:
del players[target]
async def check_idle():
while True:
await asyncio.sleep(3600)
if time.time() - last_used >= 3600:
if (
not idle_tracker["is_idle"]
and time.time() - idle_tracker["last_used"] >= 3600
):
await client.change_presence(status=disnake.Status.idle)
else:
await client.change_presence(status=disnake.Status.online)
idle_tracker["is_idle"] = True