Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
block instructions for first levelup
Browse files
app.py
CHANGED
@@ -330,7 +330,6 @@ async def add_exp(member_id):
|
|
330 |
print(f"------------------------------------------------------------------------")
|
331 |
return
|
332 |
|
333 |
-
|
334 |
# increment the old level value (better to replace outright)
|
335 |
# only increment level column if you are lvl2 or 3+ with verified role (this may make some members not appear)
|
336 |
global_df.loc[index, 'discord_level'] = current_level # do not change column name
|
@@ -349,6 +348,23 @@ async def add_exp(member_id):
|
|
349 |
print(f"Level Up! Gave {member} {current_role}")
|
350 |
|
351 |
#print(f"{member} Level up! {old_level} -> {current_level}!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
if current_role in member.roles: # needs update; reference exp reward for verification
|
353 |
#await member.send(f"Level up! {old_level} -> {current_level}!")
|
354 |
#if member_id == 811235357663297546:
|
|
|
330 |
print(f"------------------------------------------------------------------------")
|
331 |
return
|
332 |
|
|
|
333 |
# increment the old level value (better to replace outright)
|
334 |
# only increment level column if you are lvl2 or 3+ with verified role (this may make some members not appear)
|
335 |
global_df.loc[index, 'discord_level'] = current_level # do not change column name
|
|
|
348 |
print(f"Level Up! Gave {member} {current_role}")
|
349 |
|
350 |
#print(f"{member} Level up! {old_level} -> {current_level}!")
|
351 |
+
if current_level == 2: # special embed with opt-out instructions for discord newcomers
|
352 |
+
embed = Embed(color=Color.blue())
|
353 |
+
embed.set_author(name=f"{member}", icon_url=member.avatar.url if member.avatar else bot.user.avatar.url)
|
354 |
+
embed.title = f"Level Up! `{removable_role_name}` -> `{current_level}`"
|
355 |
+
msg = f'🤗 Congrats {member}! You just leveled up in the Hugging Face Discord server. To opt out of these notifications, you can right click -> "Block" me!'
|
356 |
+
embed.description = f"{msg}."
|
357 |
+
embed.add_field(name="Leaderboard Ranking:", value=f"👑 **{rank}**\n\nhttps://discord.com/channels/879548962464493619/1197143964994773023", inline=True)
|
358 |
+
msg3 = "- Posting\n- Reacting / being reacted to\n- Being active on the Hugging Face Hub (verify to link your Hub + Discord accounts!)"
|
359 |
+
embed.add_field(name="How to Level Up:", value=msg3, inline=True)
|
360 |
+
verification_link = "https://discord.com/channels/879548962464493619/900125909984624713"
|
361 |
+
embed.add_field(name="Verify Here:", value=verification_link, inline=True)
|
362 |
+
lunar = bot.get_user(811235357663297546)
|
363 |
+
await member.send(embed=embed)
|
364 |
+
await lunar.send(embed=embed)
|
365 |
+
print(f"Sent levelup embed to {member}")
|
366 |
+
return
|
367 |
+
|
368 |
if current_role in member.roles: # needs update; reference exp reward for verification
|
369 |
#await member.send(f"Level up! {old_level} -> {current_level}!")
|
370 |
#if member_id == 811235357663297546:
|