Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
update initialization of new row (both when verifying + when calling add_exp)
Browse files
app.py
CHANGED
@@ -493,7 +493,16 @@ async def add_exp(member_id):
|
|
493 |
total_exp = xp
|
494 |
verified_date = "n/a"
|
495 |
|
496 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
497 |
global_df.loc[len(global_df.index)] = row_data
|
498 |
|
499 |
print(f"------------------------------------------------------------------------")
|
@@ -538,6 +547,13 @@ async def on_message(message):
|
|
538 |
role = server.get_role(900063512829755413)
|
539 |
member = server.get_member(message.author.id)
|
540 |
verified_date = datetime.now().strftime("%m/%d/%Y, %H:%M:%S")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
541 |
# important!-----------------------------------------------------------------------------
|
542 |
# In order to add verification to a discord account, some important checks must ALL pass:
|
543 |
# 1. Discord account should not already have verified role.
|
@@ -596,7 +612,14 @@ async def on_message(message):
|
|
596 |
user['name'],
|
597 |
"L0L",
|
598 |
xp,
|
599 |
-
verified_date
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
600 |
|
601 |
global_df.loc[len(global_df.index)] = row_data
|
602 |
await member.add_roles(role)
|
|
|
493 |
total_exp = xp
|
494 |
verified_date = "n/a"
|
495 |
|
496 |
+
# need to initialize these when creating new record
|
497 |
+
likes = 0
|
498 |
+
models = 0
|
499 |
+
datasets = 0
|
500 |
+
spaces = 0
|
501 |
+
discussions = 0
|
502 |
+
papers = 0
|
503 |
+
upvotes = 0
|
504 |
+
|
505 |
+
row_data = [member_id, member_name, xp, current_level, hf_user_name, hub_exp, total_exp, verified_date, likes, models, datasets, spaces, discussions, papers, upvotes]
|
506 |
global_df.loc[len(global_df.index)] = row_data
|
507 |
|
508 |
print(f"------------------------------------------------------------------------")
|
|
|
547 |
role = server.get_role(900063512829755413)
|
548 |
member = server.get_member(message.author.id)
|
549 |
verified_date = datetime.now().strftime("%m/%d/%Y, %H:%M:%S")
|
550 |
+
likes = 0
|
551 |
+
models = 0
|
552 |
+
datasets = 0
|
553 |
+
spaces = 0
|
554 |
+
discussions = 0
|
555 |
+
papers = 0
|
556 |
+
upvotes = 0
|
557 |
# important!-----------------------------------------------------------------------------
|
558 |
# In order to add verification to a discord account, some important checks must ALL pass:
|
559 |
# 1. Discord account should not already have verified role.
|
|
|
612 |
user['name'],
|
613 |
"L0L",
|
614 |
xp,
|
615 |
+
verified_date,
|
616 |
+
likes,
|
617 |
+
models,
|
618 |
+
datasets,
|
619 |
+
spaces,
|
620 |
+
discussions,
|
621 |
+
papers,
|
622 |
+
upvotes]
|
623 |
|
624 |
global_df.loc[len(global_df.index)] = row_data
|
625 |
await member.add_roles(role)
|