Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
add_exp_hub update test
Browse files
app.py
CHANGED
|
@@ -59,28 +59,21 @@ def calculate_xp(level):
|
|
| 59 |
@bot.command(name='add_exp_hub')
|
| 60 |
async def add_exp_hub(ctx):
|
| 61 |
try:
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
# check likes
|
| 78 |
-
try:
|
| 79 |
-
likes = list_liked_repos(f"{hf_user_name}")
|
| 80 |
-
hf_likes_new = likes.total
|
| 81 |
-
worksheet2.update(f'G{row_number}', f'{hf_likes_new}')
|
| 82 |
-
except Exception as e:
|
| 83 |
-
print(f"add_exp_hub Error: {e}")
|
| 84 |
|
| 85 |
except Exception as e:
|
| 86 |
print(f"add_exp_hub Error: {e}")
|
|
|
|
| 59 |
@bot.command(name='add_exp_hub')
|
| 60 |
async def add_exp_hub(ctx):
|
| 61 |
try:
|
| 62 |
+
column_values_7 = worksheet2.col_values(7)
|
| 63 |
+
column_values_3 = worksheet2.col_values(3)
|
| 64 |
+
|
| 65 |
+
for i, value in enumerate(column_values_7):
|
| 66 |
+
if not value:
|
| 67 |
+
print(f"cell empty, updating with likes")
|
| 68 |
+
hf_user_name = column_values_3[i]
|
| 69 |
+
print(f"hf_user_name = {hf_user_name}")
|
| 70 |
+
try:
|
| 71 |
+
likes = list_liked_repos(f"{hf_user_name}")
|
| 72 |
+
hf_likes_new = likes.total
|
| 73 |
+
print(f"hf_likes_new = {hf_likes_new}")
|
| 74 |
+
worksheet2.update(f'G{row_number}', f'{hf_likes_new}')
|
| 75 |
+
except Exception as e:
|
| 76 |
+
print(f"list_liked_repos Error: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
except Exception as e:
|
| 79 |
print(f"add_exp_hub Error: {e}")
|