lunarflu HF staff commited on
Commit
e03b917
1 Parent(s): 9c84949

verify cap embed adjustment

Browse files
Files changed (1) hide show
  1. app.py +30 -31
app.py CHANGED
@@ -241,7 +241,7 @@ async def add_exp(member_id):
241
 
242
  member_found = False
243
 
244
- print("test1")
245
  # discord_user_id column
246
  # iterate over items of first column (discord_user_id)
247
  for index, cell_value in global_df.iloc[:, 0].items():
@@ -348,38 +348,37 @@ async def add_exp(member_id):
348
  if current_level >= 3: # could change to 4 maybe
349
  if verified_role not in member.roles:
350
 
351
-
352
  # L12345L -> `12345` -> 12345
353
- total_exp = total_exp[1:-1]
354
- total_exp = int(total_exp)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
 
356
- if total_exp % 30 == 0: # staggers messages so we don't send one every time exp is earned
357
- # claim exp (-30 for level 3, but +100 as bonus exp. This scales infinitely until the member verifies,
358
- # so they can continue earning exp, it just won't translate to levels and the leaderboard.
359
- # This way they can claim at any time and get a big boost in levels!
360
- claim_exp = total_exp + 70
361
-
362
- # send embed
363
- embed = Embed(color=Color.red())
364
- embed.set_author(name=f"{member}", icon_url=member.avatar.url if member.avatar else bot.user.avatar.url)
365
- embed.title = f"⚠️Your account is not Verified! Unable to level up `{old_level}` -> `{current_level}` ❌"
366
- 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!'
367
- embed.description = f"{msg}"
368
- verification_link = "https://discord.com/channels/879548962464493619/900125909984624713"
369
- embed.add_field(name="Verify Here:", value=verification_link, inline=True)
370
- u_1 = f"👑 Earn exp for activity on Discord and HF and climb the ⁠leaderboard !"
371
- u_2 = f"🌎 Feature your content in weekly news and increase its visibility!"
372
- u_3 = f"🚀 Early access to Beta features!"
373
- u_4 = f"🛡️ Secure your progress, and restore if needed!"
374
- embed.add_field(name="You can Unlock:", value=f"{u_1}\n{u_2}\n{u_3}\n{u_4}", inline=True)
375
- embed.set_image(url='https://cdn.discordapp.com/attachments/1150399343912833024/1205537451242688573/download_1.png?ex=65d8bb3e&is=65c6463e&hm=042fe7dd3521887db0bd48eeb846de1cc7c75194f9e95215c23512ff61ea3475&')
376
-
377
- lunar = bot.get_user(811235357663297546)
378
- #await member.send(embed=embed)
379
- await lunar.send(embed=embed)
380
- print(f"Sent verification cap embed to {member}")
381
- print(f"------------------------------------------------------------------------")
382
- return
383
 
384
 
385
  # increment the old level value (better to replace outright)
 
241
 
242
  member_found = False
243
 
244
+ print(f"Searching for member_id {member_id} in dataframe...")
245
  # discord_user_id column
246
  # iterate over items of first column (discord_user_id)
247
  for index, cell_value in global_df.iloc[:, 0].items():
 
348
  if current_level >= 3: # could change to 4 maybe
349
  if verified_role not in member.roles:
350
 
 
351
  # L12345L -> `12345` -> 12345
352
+ #total_exp = total_exp[1:-1]
353
+ #total_exp = int(total_exp)
354
+
355
+ #if total_exp % 30 == 0: # staggers messages so we don't send one every time exp is earned
356
+ # claim exp (-30 for level 3, but +100 as bonus exp. This scales infinitely until the member verifies,
357
+ # so they can continue earning exp, it just won't translate to levels and the leaderboard.
358
+ # This way they can claim at any time and get a big boost in levels!
359
+ claim_exp = total_exp + 70
360
+
361
+ # send embed
362
+ embed = Embed(color=Color.red())
363
+ embed.set_author(name=f"{member}", icon_url=member.avatar.url if member.avatar else bot.user.avatar.url)
364
+ embed.title = f"⚠️Your account is not Verified! Unable to level up `{old_level}` -> `{current_level}` ❌"
365
+ 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!'
366
+ embed.description = f"{msg}"
367
+ verification_link = "https://discord.com/channels/879548962464493619/900125909984624713"
368
+ embed.add_field(name="Verify Here:", value=verification_link, inline=True)
369
+ u_1 = f"👑 Earn exp for activity on Discord and HF and climb the ⁠leaderboard !"
370
+ u_2 = f"🌎 Feature your content in weekly news and increase its visibility!"
371
+ u_3 = f"🚀 Early access to Beta features!"
372
+ u_4 = f"🛡️ Secure your progress, and restore if needed!"
373
+ embed.add_field(name="You can Unlock:", value=f"{u_1}\n{u_2}\n{u_3}\n{u_4}", inline=True)
374
+ embed.set_image(url='https://cdn.discordapp.com/attachments/1150399343912833024/1205537451242688573/download_1.png?ex=65d8bb3e&is=65c6463e&hm=042fe7dd3521887db0bd48eeb846de1cc7c75194f9e95215c23512ff61ea3475&')
375
 
376
+ lunar = bot.get_user(811235357663297546)
377
+ #await member.send(embed=embed)
378
+ await lunar.send(embed=embed)
379
+ print(f"Sent verification cap embed to {member}")
380
+ print(f"------------------------------------------------------------------------")
381
+ return
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
 
383
 
384
  # increment the old level value (better to replace outright)