lunarflu HF staff commited on
Commit
c78fdb7
β€’
1 Parent(s): eb0e82f

remove member

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -871,17 +871,16 @@ def verify_button(profile: gr.OAuthProfile | None, request: gr.Request) -> str:
871
 
872
  if pd.isnull(hf_user_name) or hf_user_name == 'n/a':
873
  # empty (no link created yet between discord_user_id and hf_user_name) so we can update
874
- member = bot.get_member(user_id) # only works if we allow some time after bot restarts
875
  verified_date = datetime.now().strftime("%m/%d/%Y, %H:%M:%S")
876
  global_df.loc[global_df['discord_user_id'] == altered_member_id, 'hf_user_name'] = profile.username
877
  global_df.loc[global_df['discord_user_id'] == altered_member_id, 'verified_date'] = verified_date
878
  org_link = "https://huggingface.co/organizations/discord-community/share/wPKRAHYbAlaEaCxUxcqVyaaaeZcYagDvqc"
879
  invite_message = "Click to join our community org on the HF Hub!"
880
- return (f"# βœ… Verification successful! [{member} <---> {profile.username}] πŸ€—\n{invite_message}\n{org_link} ")
881
- print(f"# βœ… Verification successful! [{member} <---> {profile.username}] πŸ€—")
882
  else:
883
- return (f"# ❌ The Discord account {member} is already verified! To change discord accounts or HF accounts, contact @lunarflu or adam@huggingface.co")
884
- print(f"# ❌ The Discord account {member} is already verified! To change discord accounts or HF accounts, contact @lunarflu or adam@huggingface.co")
885
 
886
  # Remove the token after successful verification
887
  del user_tokens[int(user_id)]
 
871
 
872
  if pd.isnull(hf_user_name) or hf_user_name == 'n/a':
873
  # empty (no link created yet between discord_user_id and hf_user_name) so we can update
 
874
  verified_date = datetime.now().strftime("%m/%d/%Y, %H:%M:%S")
875
  global_df.loc[global_df['discord_user_id'] == altered_member_id, 'hf_user_name'] = profile.username
876
  global_df.loc[global_df['discord_user_id'] == altered_member_id, 'verified_date'] = verified_date
877
  org_link = "https://huggingface.co/organizations/discord-community/share/wPKRAHYbAlaEaCxUxcqVyaaaeZcYagDvqc"
878
  invite_message = "Click to join our community org on the HF Hub!"
879
+ return (f"# βœ… Verification successful! [Discord ID {user_id} <---> {profile.username}] πŸ€—\n{invite_message}\n{org_link} ")
880
+ print(f"# βœ… Verification successful! [Discord ID {user_id} <---> {profile.username}] πŸ€—")
881
  else:
882
+ return (f"# ❌ The Discord account {user_id} is already verified! To change discord accounts or HF accounts, contact @lunarflu or adam@huggingface.co")
883
+ print(f"# ❌ The Discord account {user_id} is already verified! To change discord accounts or HF accounts, contact @lunarflu or adam@huggingface.co")
884
 
885
  # Remove the token after successful verification
886
  del user_tokens[int(user_id)]