SleepyBoyStudios / theTechnicianBot

1 stars 0 forks source link

Integrate into logic.py and eventually routing.py also #22

Open eliteabhi opened 2 years ago

eliteabhi commented 2 years ago

[thetechnicianbot] ../../../../../home/abhi/Documents/Code/Python/theTechnicianBot/src/data_access.py (Lines 181-194)


    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

Open in IDE · Open on GitHub

Created from VS Code using CodeStream