lunarflu HF staff commited on
Commit
0d65349
·
verified ·
1 Parent(s): a5b75bb

Only send DM if total_exp % 30 == 0:

Browse files
Files changed (1) hide show
  1. app.py +27 -27
app.py CHANGED
@@ -302,33 +302,33 @@ async def add_exp(member_id):
302
  total_exp = total_exp[1:-1]
303
  total_exp = int(total_exp)
304
 
305
- #if total_exp % 30 == 0: # staggers messages so we don't send one every time exp is earned
306
- # claim exp (-30 for level 3, but +100 as bonus exp. This scales infinitely until the member verifies,
307
- # so they can continue earning exp, it just won't translate to levels and the leaderboard.
308
- # This way they can claim at any time and get a big boost in levels!
309
- claim_exp = total_exp + 70
310
-
311
- # send embed
312
- embed = Embed(color=Color.red())
313
- embed.set_author(name=f"{member}", icon_url=member.avatar.url if member.avatar else bot.user.avatar.url)
314
- embed.title = f"⚠️Your account is not Verified! Unable to level up `🚀` -> `{current_level}` ❌"
315
- msg = f'🤗 Hey {member}! You can continue leveling up in the Hugging Face Discord server by Verifying your account, and claim `{claim_exp}` bonus exp points!'
316
- embed.description = f"{msg}"
317
- verification_link = "https://discord.com/channels/879548962464493619/900125909984624713"
318
- embed.add_field(name="Verify Here:", value=verification_link, inline=True)
319
- u_1 = f"👑 Earn exp for activity on Discord and HF and climb the ⁠leaderboard !"
320
- u_2 = f"🌎 Feature your content in weekly news and increase its visibility!"
321
- u_3 = f"🚀 Early access to Beta features!"
322
- u_4 = f"🛡️ Secure your progress, and restore if needed!"
323
- embed.add_field(name="You can Unlock:", value=f"{u_1}\n{u_2}\n{u_3}\n{u_4}", inline=True)
324
- embed.set_image(url='https://cdn.discordapp.com/attachments/1150399343912833024/1205537451242688573/download_1.png?ex=65d8bb3e&is=65c6463e&hm=042fe7dd3521887db0bd48eeb846de1cc7c75194f9e95215c23512ff61ea3475&')
325
-
326
- lunar = bot.get_user(811235357663297546)
327
- await member.send(embed=embed)
328
- await lunar.send(embed=embed)
329
- print(f"Sent verification cap embed to {member}")
330
- print(f"------------------------------------------------------------------------")
331
- return
332
 
333
 
334
  # increment the old level value (better to replace outright)
 
302
  total_exp = total_exp[1:-1]
303
  total_exp = int(total_exp)
304
 
305
+ if total_exp % 30 == 0: # staggers messages so we don't send one every time exp is earned
306
+ # claim exp (-30 for level 3, but +100 as bonus exp. This scales infinitely until the member verifies,
307
+ # so they can continue earning exp, it just won't translate to levels and the leaderboard.
308
+ # This way they can claim at any time and get a big boost in levels!
309
+ claim_exp = total_exp + 70
310
+
311
+ # send embed
312
+ embed = Embed(color=Color.red())
313
+ embed.set_author(name=f"{member}", icon_url=member.avatar.url if member.avatar else bot.user.avatar.url)
314
+ embed.title = f"⚠️Your account is not Verified! Unable to level up `🚀` -> `{current_level}` ❌"
315
+ msg = f'🤗 Hey {member}! You can continue leveling up in the Hugging Face Discord server by Verifying your account, and claim `{claim_exp}` bonus exp points!'
316
+ embed.description = f"{msg}"
317
+ verification_link = "https://discord.com/channels/879548962464493619/900125909984624713"
318
+ embed.add_field(name="Verify Here:", value=verification_link, inline=True)
319
+ u_1 = f"👑 Earn exp for activity on Discord and HF and climb the ⁠leaderboard !"
320
+ u_2 = f"🌎 Feature your content in weekly news and increase its visibility!"
321
+ u_3 = f"🚀 Early access to Beta features!"
322
+ u_4 = f"🛡️ Secure your progress, and restore if needed!"
323
+ embed.add_field(name="You can Unlock:", value=f"{u_1}\n{u_2}\n{u_3}\n{u_4}", inline=True)
324
+ embed.set_image(url='https://cdn.discordapp.com/attachments/1150399343912833024/1205537451242688573/download_1.png?ex=65d8bb3e&is=65c6463e&hm=042fe7dd3521887db0bd48eeb846de1cc7c75194f9e95215c23512ff61ea3475&')
325
+
326
+ lunar = bot.get_user(811235357663297546)
327
+ await member.send(embed=embed)
328
+ await lunar.send(embed=embed)
329
+ print(f"Sent verification cap embed to {member}")
330
+ print(f"------------------------------------------------------------------------")
331
+ return
332
 
333
 
334
  # increment the old level value (better to replace outright)