Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
verify level cap test
Browse files
app.py
CHANGED
@@ -237,6 +237,36 @@ async def add_exp(member_id):
|
|
237 |
if current_level >= 2 and current_level <=30:
|
238 |
current_role = lvls[current_level]
|
239 |
if current_role not in member.roles: # if we leveled up
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
await member.add_roles(current_role)
|
241 |
print(f"Level Up! Gave {member} {current_role}")
|
242 |
await member.remove_roles(lvls[current_level-1])
|
|
|
237 |
if current_level >= 2 and current_level <=30:
|
238 |
current_role = lvls[current_level]
|
239 |
if current_role not in member.roles: # if we leveled up
|
240 |
+
|
241 |
+
# temporary fix: remove ~100 exp when not verified, send embed on "levelup" prompting to verify
|
242 |
+
# if level 3 -> then send embed, remove some exp
|
243 |
+
verified_role = guild.get_role(900063512829755413)
|
244 |
+
if verified_role not in member.roles:
|
245 |
+
|
246 |
+
# send embed
|
247 |
+
embed = Embed(color=Color.red())
|
248 |
+
embed.set_author(name=f"{member}", icon_url=member.avatar.url if member.avatar else bot.user.avatar.url)
|
249 |
+
embed.title = f"⚠️Your account is not Verified! Unable to Level Up `{current_level-1}` -> `{current_level}` ❌"
|
250 |
+
msg = f'🤗 Hey {member}! You can continue Leveling Up in the Hugging Face Discord server by Verifying your account!'
|
251 |
+
embed.description = f"{msg}."
|
252 |
+
verification_link = "https://discord.com/channels/879548962464493619/900125909984624713"
|
253 |
+
embed.add_field(name="Verify Here:", value=verification_link, inline=True)
|
254 |
+
u_1 = f"👑 Earn exp for activity on Discord and HF and climb the leaderboard !"
|
255 |
+
u_2 = f"🌎 Feature your content in weekly news and increase its visibility!"
|
256 |
+
u_3 = f"🚀 Early access to Beta features!"
|
257 |
+
u_4 = f"🛡️ Secure your progress, and restore if needed!"
|
258 |
+
embed.add_field(name="You can Unlock:", value=f"{u_1}\n{u_2}\n{u_3}\n{u_4}", inline=True)
|
259 |
+
embed.set_image(url='https://cdn.discordapp.com/attachments/1150399343912833024/1205537451242688573/download_1.png?ex=65d8bb3e&is=65c6463e&hm=042fe7dd3521887db0bd48eeb846de1cc7c75194f9e95215c23512ff61ea3475&')
|
260 |
+
|
261 |
+
lunar = bot.get_user(811235357663297546)
|
262 |
+
await lunar.send(embed=embed)
|
263 |
+
|
264 |
+
|
265 |
+
|
266 |
+
|
267 |
+
|
268 |
+
|
269 |
+
|
270 |
await member.add_roles(current_role)
|
271 |
print(f"Level Up! Gave {member} {current_role}")
|
272 |
await member.remove_roles(lvls[current_level-1])
|