Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
#20
by
nroggendorff
- opened
app.py
CHANGED
@@ -592,11 +592,10 @@ async def on_reaction_add(reaction, user):
|
|
592 |
if user.id not in bot_ids:
|
593 |
print(f"adding exp from react {user}")
|
594 |
await asyncio.sleep(0.1)
|
595 |
-
if not isinstance(reaction.message.channel, discord.DMChannel): # can't earn exp from reacting in bot DMs, which is harder to track
|
596 |
-
await add_exp(user.id)
|
597 |
-
await asyncio.sleep(0.1)
|
598 |
-
if reaction.message.author.id != user.id: # can't earn while self-reacting, which is abuseable
|
599 |
await add_exp(reaction.message.author.id)
|
|
|
|
|
600 |
except Exception as e:
|
601 |
print(f"on_reaction_add Error: {e}")
|
602 |
|
@@ -650,7 +649,7 @@ async def remove_huggingfolks():
|
|
650 |
top_num = 30
|
651 |
top_num_exp = community_global_df.nlargest(top_num, 'total_exp')
|
652 |
|
653 |
-
top_num_exp['D'] = ['π₯','π₯','π₯'
|
654 |
top_num_rows = top_num_exp.values.tolist()
|
655 |
|
656 |
#print(top_30_rows)
|
|
|
592 |
if user.id not in bot_ids:
|
593 |
print(f"adding exp from react {user}")
|
594 |
await asyncio.sleep(0.1)
|
595 |
+
if not isinstance(reaction.message.channel, discord.DMChannel) and reaction.message.author.id != user.id: # can't earn exp from reacting in bot DMs, which is harder to track, and can't earn while self-reacting, which is abuseable
|
|
|
|
|
|
|
596 |
await add_exp(reaction.message.author.id)
|
597 |
+
await asyncio.sleep(0.1)
|
598 |
+
|
599 |
except Exception as e:
|
600 |
print(f"on_reaction_add Error: {e}")
|
601 |
|
|
|
649 |
top_num = 30
|
650 |
top_num_exp = community_global_df.nlargest(top_num, 'total_exp')
|
651 |
|
652 |
+
top_num_exp['D'] = ['π₯','π₯','π₯'] + [''] * (top_num - 3)
|
653 |
top_num_rows = top_num_exp.values.tolist()
|
654 |
|
655 |
#print(top_30_rows)
|