Spaces:
Running on CPU Upgrade

lunarflu HF staff commited on
Commit
0cc961e
·
verified ·
1 Parent(s): 4f8a08d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -165,9 +165,11 @@ async def add_exp(member_id):
165
  }
166
 
167
  data = pd.read_csv(csv_file)
 
168
  for index, cell_value in data.iloc[:, 0].items():
169
  if cell_value == member_id:
170
  # if found, update that row...
 
171
  print(f"Record for {member} found at row {index + 1}, column 1")
172
 
173
  # increment the old experience value (better not to replace outright)
@@ -190,7 +192,7 @@ async def add_exp(member_id):
190
  if current_role in member.roles:
191
  await member.send(f"Level up! {current_level-1} -> {current_level}!")
192
 
193
- else:
194
  # if not, create new record
195
  print(f"creating new record for {member}")
196
  #string_member_id = str(member.id)
 
165
  }
166
 
167
  data = pd.read_csv(csv_file)
168
+ member_found = False
169
  for index, cell_value in data.iloc[:, 0].items():
170
  if cell_value == member_id:
171
  # if found, update that row...
172
+ member_found = True
173
  print(f"Record for {member} found at row {index + 1}, column 1")
174
 
175
  # increment the old experience value (better not to replace outright)
 
192
  if current_role in member.roles:
193
  await member.send(f"Level up! {current_level-1} -> {current_level}!")
194
 
195
+ if not member_found:
196
  # if not, create new record
197
  print(f"creating new record for {member}")
198
  #string_member_id = str(member.id)