From e4313b439a47c8ae399d2e6fba51c07e9dfb54b4 Mon Sep 17 00:00:00 2001 From: nsde Date: Sat, 19 Aug 2023 13:38:03 +0200 Subject: [PATCH] Finally fixed the credit system! --- rewards/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rewards/main.py b/rewards/main.py index 6a04aaa..cac3e61 100644 --- a/rewards/main.py +++ b/rewards/main.py @@ -24,8 +24,8 @@ async def update_roles(): return level_role_names = [f'lvl{lvl}' for lvl in range(10, 110, 10)] - users = await autocredits.get_all_users() - users = users.find({}) + users_doc = await autocredits.get_all_users() + users = users_doc.find({}) users = await users.to_list(length=None) @@ -39,10 +39,11 @@ async def update_roles(): if user_id == discord: for role in level_role_names: if role in role_names: - users.update_one( + users_doc.update_one( {'auth.discord': discord}, {'$set': {'level': role}} ) + print(f'Updated {discord} to {role}') return users