mirror of
https://github.com/NovaOSS/nova-api.git
synced 2024-11-29 10:03:56 +01:00
13 lines
409 B
Python
13 lines
409 B
Python
async def get_all_users(client):
|
|
users = client['nova-core']['users']
|
|
return users
|
|
|
|
async def update_credits(users, settings=None):
|
|
if not settings:
|
|
users.update_many({}, {"$inc": {"credits": 250}})
|
|
|
|
else:
|
|
for key, value in settings.items():
|
|
users.update_many({'role': key}, {"$inc": {"credits": int(value)}})
|
|
print(f'Updated {key} to {value}')
|