Prechádzať zdrojové kódy

Fixed problems with the periodic update of team members and team roles.

BaumSplitter41 4 mesiacov pred
rodič
commit
e12bc52c13
1 zmenil súbory, kde vykonal 11 pridanie a 15 odobranie
  1. 11 15
      VPD_BOT/main.py

+ 11 - 15
VPD_BOT/main.py

@@ -561,21 +561,7 @@ async def update_users_periodically():
                     conn.commit()
         except Exception as e:
             print(f"Error updating users: {e}")
-        
-        await asyncio.sleep(600)  # Update every 10 minutes
-
-
-
-
 
-#_________________________________#
-## TXADMIN ROLE PERMISSIONS
-
-#Get Team Members periodically
-async def update_team_periodically():
-    await bot.wait_until_ready()
-    await asyncio.sleep(10)  # Wait a bit to ensure bot is fully ready
-    while not bot.is_closed():
         if team_role_id:
             for guild in bot.guilds:
                 team_role = guild.get_role(int(team_role_id))
@@ -594,7 +580,17 @@ async def update_team_periodically():
                             batch_count = 0
                 if batch_count > 0:
                     conn.commit()
-            await asyncio.sleep(600)  # Update every 10 minutes
+        
+        await asyncio.sleep(60)  # Update every 1 minutes
+
+
+
+
+
+#_________________________________#
+## TXADMIN ROLE PERMISSIONS
+
+
 
 #---------------------------------#
 #Run function