Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
top_num -> 10
Browse files
app.py
CHANGED
@@ -691,34 +691,26 @@ async def remove_huggingfolks():
|
|
691 |
# add profile hyperlinks to gradio demo
|
692 |
community_global_df_gradio = community_global_df
|
693 |
community_global_df_gradio['hf_user_name'] = community_global_df_gradio['hf_user_name'].apply(format_hyperlink)
|
|
|
|
|
|
|
694 |
|
695 |
-
|
696 |
-
|
697 |
-
top_25_exp['D'] = ['🥇','🥈','🥉','','','','','','','','','','','','','','','','','','','','','','']
|
698 |
-
top_25_rows = top_25_exp.values.tolist()
|
699 |
|
700 |
#print(top_30_rows)
|
701 |
channel = bot.get_channel(1197143964994773023)
|
702 |
message = await channel.fetch_message(1197148293164187678)
|
703 |
|
704 |
# put into message / leaderboard
|
705 |
-
new_table = tabulate(
|
706 |
await message.edit(content=f"Updated Leaderboard:\n```\n{new_table}\n```")
|
707 |
print(f"Updated discord leaderboard!")
|
708 |
print(f"------------------------------------------------------------------------")
|
709 |
except Exception as e:
|
710 |
-
print(f"remove_huggingfolks Error: {e}")
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
#---------------------------------------------------------------------------------------------
|
715 |
-
# UPDATE dataframe WITH HFAPI INFO on a timer
|
716 |
-
|
717 |
|
718 |
|
719 |
-
|
720 |
-
#---------------------------------------------------------------------------------------------
|
721 |
-
|
722 |
@bot.command(name='xp_help')
|
723 |
async def xp_help(ctx):
|
724 |
try:
|
@@ -735,17 +727,6 @@ async def count_users_with_role(ctx, role_id):
|
|
735 |
await ctx.send(f"Number of users with the role '{role.name}': {count}")
|
736 |
|
737 |
|
738 |
-
|
739 |
-
# embeds with user pfps?
|
740 |
-
# name, pfp, time in server.....
|
741 |
-
|
742 |
-
# weekly do different count
|
743 |
-
# count number of messages per user for every channel (total messages)
|
744 |
-
# fix sheet if necessary
|
745 |
-
# add emojis for some color
|
746 |
-
# check if members are still in the server
|
747 |
-
|
748 |
-
|
749 |
""""""
|
750 |
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
751 |
def run_bot():
|
|
|
691 |
# add profile hyperlinks to gradio demo
|
692 |
community_global_df_gradio = community_global_df
|
693 |
community_global_df_gradio['hf_user_name'] = community_global_df_gradio['hf_user_name'].apply(format_hyperlink)
|
694 |
+
|
695 |
+
top_num = 10
|
696 |
+
top_num_exp = community_global_df.nlargest(top_num, 'total_exp')
|
697 |
|
698 |
+
top_num_exp['D'] = ['🥇','🥈','🥉','','','','','','','']
|
699 |
+
top_num_rows = top_num_exp.values.tolist()
|
|
|
|
|
700 |
|
701 |
#print(top_30_rows)
|
702 |
channel = bot.get_channel(1197143964994773023)
|
703 |
message = await channel.fetch_message(1197148293164187678)
|
704 |
|
705 |
# put into message / leaderboard
|
706 |
+
new_table = tabulate(top_num_rows, headers=["Name", "Level", "Experience", "Rank"], tablefmt="plain")
|
707 |
await message.edit(content=f"Updated Leaderboard:\n```\n{new_table}\n```")
|
708 |
print(f"Updated discord leaderboard!")
|
709 |
print(f"------------------------------------------------------------------------")
|
710 |
except Exception as e:
|
711 |
+
print(f"remove_huggingfolks Error: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
712 |
|
713 |
|
|
|
|
|
|
|
714 |
@bot.command(name='xp_help')
|
715 |
async def xp_help(ctx):
|
716 |
try:
|
|
|
727 |
await ctx.send(f"Number of users with the role '{role.name}': {count}")
|
728 |
|
729 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
730 |
""""""
|
731 |
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
732 |
def run_bot():
|