Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
old_total_xp = int(total_exp) old_level = calculate_level(old_total_xp)
Browse files
app.py
CHANGED
@@ -266,19 +266,11 @@ async def add_exp(member_id):
|
|
266 |
|
267 |
# increment the old experience value (better not to replace outright)
|
268 |
old_xp = global_df.loc[index, 'discord_exp']
|
269 |
-
old_total_xp = global_df.loc[index, 'total_exp']
|
270 |
-
|
271 |
-
# add to discord exp (this is input)
|
272 |
-
# add discord exp and hub exp to total_exp
|
273 |
-
# set level based on total_exp (this is output)
|
274 |
|
275 |
# remove L (write, so we replace)
|
276 |
old_xp = str(old_xp)
|
277 |
if old_xp.startswith("L") and old_xp.endswith("L"):
|
278 |
-
old_xp = old_xp[1:-1]
|
279 |
-
|
280 |
-
# set old level; use this for more accurate logging and jumping multiple levels at once (for example, verifying)
|
281 |
-
old_level = calculate_level(int(old_total_xp))
|
282 |
|
283 |
# str -> int temporarily for adding
|
284 |
new_xp = int(old_xp) + XP_PER_MESSAGE
|
@@ -295,7 +287,9 @@ async def add_exp(member_id):
|
|
295 |
if hub_xp.startswith("L") and hub_xp.endswith("L"):
|
296 |
hub_xp = hub_xp[1:-1]
|
297 |
|
|
|
298 |
old_total_xp = int(total_exp)
|
|
|
299 |
|
300 |
# check if hub exp not empty
|
301 |
if hub_xp.strip():
|
|
|
266 |
|
267 |
# increment the old experience value (better not to replace outright)
|
268 |
old_xp = global_df.loc[index, 'discord_exp']
|
|
|
|
|
|
|
|
|
|
|
269 |
|
270 |
# remove L (write, so we replace)
|
271 |
old_xp = str(old_xp)
|
272 |
if old_xp.startswith("L") and old_xp.endswith("L"):
|
273 |
+
old_xp = old_xp[1:-1]
|
|
|
|
|
|
|
274 |
|
275 |
# str -> int temporarily for adding
|
276 |
new_xp = int(old_xp) + XP_PER_MESSAGE
|
|
|
287 |
if hub_xp.startswith("L") and hub_xp.endswith("L"):
|
288 |
hub_xp = hub_xp[1:-1]
|
289 |
|
290 |
+
# set old level; use this for more accurate logging and jumping multiple levels at once (for example, verifying)
|
291 |
old_total_xp = int(total_exp)
|
292 |
+
old_level = calculate_level(old_total_xp)
|
293 |
|
294 |
# check if hub exp not empty
|
295 |
if hub_xp.strip():
|