lunarflu HF staff commited on
Commit
6fd7cd9
·
verified ·
1 Parent(s): 0db522b

str(member_id) to be compatible with sheets

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -175,7 +175,7 @@ async def add_exp(member_id):
175
 
176
  member_found = False
177
  for index, cell_value in global_df.iloc[:, 0].items():
178
- if cell_value == member_id:
179
  # if found, update that row...
180
  member_found = True
181
  print(f"Record for {member} found at row {index + 1}, column 1")
@@ -207,14 +207,18 @@ async def add_exp(member_id):
207
  # if not, create new record
208
  print(f"creating new record for {member}")
209
  #string_member_id = str(member.id)
 
210
  xp = 10 # define somewhere else?
211
  current_level = calculate_level(xp)
212
  member_name = member.name
 
213
  row_data = [member_id, member_name, xp, current_level]
 
214
  new_row_df = pd.DataFrame([row_data], columns=global_df.columns)
215
  print(type(global_df))
216
  #updated_df = global_df.append(new_row_df, ignore_index=True) deprecated
217
  updated_df = pd.concat([global_df, pd.DataFrame([new_row_df])], ignore_index=True)
 
218
  # initial role assignment
219
  if current_level == 1:
220
  if lvl1 not in member.roles:
 
175
 
176
  member_found = False
177
  for index, cell_value in global_df.iloc[:, 0].items():
178
+ if cell_value == str(member_id):
179
  # if found, update that row...
180
  member_found = True
181
  print(f"Record for {member} found at row {index + 1}, column 1")
 
207
  # if not, create new record
208
  print(f"creating new record for {member}")
209
  #string_member_id = str(member.id)
210
+
211
  xp = 10 # define somewhere else?
212
  current_level = calculate_level(xp)
213
  member_name = member.name
214
+ print(f"test")
215
  row_data = [member_id, member_name, xp, current_level]
216
+ print(f"test")
217
  new_row_df = pd.DataFrame([row_data], columns=global_df.columns)
218
  print(type(global_df))
219
  #updated_df = global_df.append(new_row_df, ignore_index=True) deprecated
220
  updated_df = pd.concat([global_df, pd.DataFrame([new_row_df])], ignore_index=True)
221
+ print(f"test")
222
  # initial role assignment
223
  if current_level == 1:
224
  if lvl1 not in member.roles: