servers: list = list(user_xp.keys()) # Get the list of servers
lvl_xp -= sum(user_xp.values()) # Subtracts the total xp from the xp needed for the next level
x = lvl_xp // len(servers) # Gets the xp needed for each server
for _ in servers:
add_xp(id, _, x) # Adds remainder xp to the user
if lvl_xp % len(servers) != 0:
mod_amount = lvl_xp % len(servers)
for _ in range(mod_amount):
add_xp(id, servers[_], 1) # Adds xp to the user
[thetechnicianbot] ../../../../../home/abhi/Documents/Code/Python/theTechnicianBot/src/data_access.py (Lines 181-194)
Open in IDE · Open on GitHub
Created from VS Code using CodeStream