lunarflu HF staff commited on
Commit
3cfac71
·
verified ·
1 Parent(s): 61513be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -13
app.py CHANGED
@@ -90,32 +90,19 @@ async def give_verified_roles():
90
  # Extract Hugging Face username
91
  hf_user_name = row['hf_user_name']
92
  if pd.notna(hf_user_name) and hf_user_name.lower() != 'n/a':
93
- print(f"Valid HF username found: {hf_user_name}")
94
-
95
- # Extract and clean Discord ID
96
  discord_id = row['discord_user_id'].strip('L')
97
- print(f"Cleaned Discord ID: {discord_id}")
98
-
99
- # Get the guild member
100
  member = guild.get_member(int(discord_id))
101
  if not member:
102
  print(f"Member with Discord ID {discord_id} not found.")
103
  continue
104
  print(f"Member found: {member}")
105
-
106
- # Check if the member already has the role
107
  if role not in member.roles:
108
  print(f"Adding role to member: {member}")
109
  await member.add_roles(role)
110
  print(f"Role added to member: {member}")
111
-
112
- # Notify Lunar
113
  lunar = bot.get_user(811235357663297546)
114
  if lunar:
115
- print(f"Notifying Lunar about verification for {member}")
116
  await lunar.send(f"Verified role given to {member}!")
117
-
118
- # Notify the member
119
  print(f"Sending success message to {member}")
120
  await member.send(
121
  f"Verification successful! [{member} <---> {row['discord_user_name']}] \n🤗 {org_link} {invite_message}"
 
90
  # Extract Hugging Face username
91
  hf_user_name = row['hf_user_name']
92
  if pd.notna(hf_user_name) and hf_user_name.lower() != 'n/a':
 
 
 
93
  discord_id = row['discord_user_id'].strip('L')
 
 
 
94
  member = guild.get_member(int(discord_id))
95
  if not member:
96
  print(f"Member with Discord ID {discord_id} not found.")
97
  continue
98
  print(f"Member found: {member}")
 
 
99
  if role not in member.roles:
100
  print(f"Adding role to member: {member}")
101
  await member.add_roles(role)
102
  print(f"Role added to member: {member}")
 
 
103
  lunar = bot.get_user(811235357663297546)
104
  if lunar:
 
105
  await lunar.send(f"Verified role given to {member}!")
 
 
106
  print(f"Sending success message to {member}")
107
  await member.send(
108
  f"Verification successful! [{member} <---> {row['discord_user_name']}] \n🤗 {org_link} {invite_message}"