Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
test update
Browse files
app.py
CHANGED
@@ -342,7 +342,12 @@ async def remove_huggingfolks():
|
|
342 |
top_30_rows = top_30_exp.values.tolist()
|
343 |
|
344 |
print(top_30_rows)
|
|
|
|
|
345 |
|
|
|
|
|
|
|
346 |
|
347 |
except Exception as e:
|
348 |
print(f"remove_huggingfolks Error: {e}")
|
@@ -361,8 +366,7 @@ async def update_leaderboard(): # needs rewrite
|
|
361 |
names_list = worksheet.col_values(2)[1:]
|
362 |
levels_list = worksheet.col_values(4)[1:]
|
363 |
exp_list = worksheet.col_values(3)[1:]
|
364 |
-
|
365 |
-
message = await channel.fetch_message(1197148293164187678)
|
366 |
|
367 |
# for 3 lists
|
368 |
combined_list = [list(sublist) for sublist in zip(names_list, levels_list, exp_list)]
|
@@ -395,10 +399,7 @@ async def update_leaderboard(): # needs rewrite
|
|
395 |
return (xp_to_level_up)
|
396 |
|
397 |
|
398 |
-
|
399 |
-
new_leaderboard_data = [(name, level, str(xp_required_to_next_level(int(level), int(xp)))) for name, level, xp in top_results]
|
400 |
-
new_table = tabulate(new_leaderboard_data, headers=["Name", "Level", "XP to level up"], tablefmt="plain")
|
401 |
-
await message.edit(content=f"Updated Leaderboard:\n```\n{new_table}\n```")
|
402 |
except Exception as e:
|
403 |
print(f"update_leaderboard Error: {e}")
|
404 |
|
|
|
342 |
top_30_rows = top_30_exp.values.tolist()
|
343 |
|
344 |
print(top_30_rows)
|
345 |
+
channel = bot.get_channel(1197143964994773023)
|
346 |
+
message = await channel.fetch_message(1197148293164187678)
|
347 |
|
348 |
+
# put into message / leaderboard
|
349 |
+
new_table = tabulate(top_30_rows, headers=["Name", "Experience", "Level"], tablefmt="plain")
|
350 |
+
await message.edit(content=f"Updated Leaderboard:\n```\n{new_table}\n```")
|
351 |
|
352 |
except Exception as e:
|
353 |
print(f"remove_huggingfolks Error: {e}")
|
|
|
366 |
names_list = worksheet.col_values(2)[1:]
|
367 |
levels_list = worksheet.col_values(4)[1:]
|
368 |
exp_list = worksheet.col_values(3)[1:]
|
369 |
+
|
|
|
370 |
|
371 |
# for 3 lists
|
372 |
combined_list = [list(sublist) for sublist in zip(names_list, levels_list, exp_list)]
|
|
|
399 |
return (xp_to_level_up)
|
400 |
|
401 |
|
402 |
+
|
|
|
|
|
|
|
403 |
except Exception as e:
|
404 |
print(f"update_leaderboard Error: {e}")
|
405 |
|