lunarflu HF staff commited on
Commit
b9acbd0
1 Parent(s): 3a8de98

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -259,15 +259,19 @@ async def restore_exp(ctx):
259
  level = calculate_level(xp+1)
260
  user = await bot.fetch_user(member_id)
261
  # get column name / data to safetycheck
262
- worksheet.append_column([user.id], index=1)
263
- worksheet.append_column([user.name], index=2)
264
- worksheet.append_column([xp], index=3)
265
- worksheet.append_column([level], index=4)
266
-
267
-
 
 
268
 
269
 
270
 
 
 
271
 
272
  except Exception as e:
273
  print(f"Error: {e}")
 
259
  level = calculate_level(xp+1)
260
  user = await bot.fetch_user(member_id)
261
  # get column name / data to safetycheck
262
+
263
+ # does a record already exist?
264
+ cell = worksheet.find(member_id)
265
+ # if so, update that row...
266
+
267
+ # if not, create new record
268
+ length = len(worksheet.col_values('A'))
269
+ print(length)
270
 
271
 
272
 
273
+
274
+
275
 
276
  except Exception as e:
277
  print(f"Error: {e}")