lunarflu HF staff commited on
Commit
c3aee4c
1 Parent(s): 277953c

some fixes

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -218,13 +218,16 @@ async def add_exp(member_id, message):
218
  if current_role in member.roles: # needs update; reference exp reward for verification
219
  #await member.send(f"Level up! {current_level-1} -> {current_level}!")
220
  if member_id == 811235357663297546:
221
- row = global_df[global_df['discord_user_id'] == str(message.content)] # does this need to be string?
 
 
 
222
  if not row.empty:
223
  target_exp = row['discord_exp'].values[0]
224
  rank = (global_df['discord_exp'] > target_exp).sum() + 1
225
- print(f"The rank for discord_id {message.content} based on discord_exp is: {rank}")
226
  else:
227
- print(f"Discord ID {message.content} not found in the DataFrame.")
228
 
229
  # send embed
230
  embed = Embed(color=Color.blue())
@@ -240,7 +243,7 @@ async def add_exp(member_id, message):
240
  # 2 [you are here]
241
  # 3 osanseviero
242
  # also, ahead by how much exp, how many levels maybe
243
- msg3 = "- Posting \n Reacting / being reacted to \n Being active on the Hugging Face Hub (verify to link your Hub + Discord accounts!)"
244
  embed.add_field(name="How to Level Up:", value=msg3, inline=True)
245
  verification_link = "https://discord.com/channels/879548962464493619/900125909984624713"
246
  embed.add_field(name="Verify Here:", value=verification_link, inline=True)
 
218
  if current_role in member.roles: # needs update; reference exp reward for verification
219
  #await member.send(f"Level up! {current_level-1} -> {current_level}!")
220
  if member_id == 811235357663297546:
221
+
222
+ member = guild.get_member(message.content)
223
+ member_id = member.id
224
+ row = global_df[global_df['discord_user_id'] == str(member_id)] # does this need to be string?
225
  if not row.empty:
226
  target_exp = row['discord_exp'].values[0]
227
  rank = (global_df['discord_exp'] > target_exp).sum() + 1
228
+ print(f"The rank for discord_id {member_id} based on discord_exp is: {rank}")
229
  else:
230
+ print(f"Discord ID {member_id} not found in the DataFrame.")
231
 
232
  # send embed
233
  embed = Embed(color=Color.blue())
 
243
  # 2 [you are here]
244
  # 3 osanseviero
245
  # also, ahead by how much exp, how many levels maybe
246
+ msg3 = "- Posting\n- Reacting / being reacted to\n- Being active on the Hugging Face Hub (verify to link your Hub + Discord accounts!)"
247
  embed.add_field(name="How to Level Up:", value=msg3, inline=True)
248
  verification_link = "https://discord.com/channels/879548962464493619/900125909984624713"
249
  embed.add_field(name="Verify Here:", value=verification_link, inline=True)