diff --git a/main.py b/main.py index e97ba56..be94fa7 100644 --- a/main.py +++ b/main.py @@ -310,22 +310,24 @@ async def give_xp(user: voltage.User, xp:int): # USE THIS IF YOU NEED TO ADD NEW KEYS TO THE DATABASE async def do(): - curs = userdb.find() - async for user in curs: - try: - ud = client.get_user(user['userid']) - - await userdb.update_one( - {'userid':user['userid']}, - { - '$set':{ - "username": f"{ud.name}#{ud.discriminator}" + while True: + curs = userdb.find() + async for user in curs: + try: + ud = client.get_user(user['userid']) + + await userdb.update_one( + {'userid':user['userid']}, + { + '$set':{ + "username": f"{ud.name}#{ud.discriminator}" + } } - } - ) - except: - pass - print(f"Updated {(await userdb.count_documents({}))} users!") + ) + except: + pass + print(f"Updated {(await userdb.count_documents({}))} users!") + await asyncio.sleep(60*60) async def get(): """ GET Stats """