async def edit_user_role(user_id): level_id = User.get_level(user_id) if level_id > 1: role_prev_id = Level.get_reward(level_id - 1) user_roles = Bot.get_user_roles(user_id) for role in user_roles: if(role.id == role_prev_id): await Bot.delete_user_role(user_id, role.id) role_id = Level.get_reward(level_id) await Bot.apply_user_role(user_id, role_id)
def get_reward(level): return Level.get_reward(level)