Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,26 +59,26 @@ def calculate_xp(level):
|
|
| 59 |
async def add_exp_hub(ctx, discord_user_id):
|
| 60 |
try:
|
| 61 |
cell = worksheet.find(str(discord_user_id))
|
| 62 |
-
if cell.col == 5
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
worksheet.update(f'G{cell.row}', f'{hf_likes_new}')
|
| 75 |
-
"""
|
| 76 |
-
for i in range(difference):
|
| 77 |
-
await add_exp(discord_user_id)
|
| 78 |
-
"""
|
| 79 |
-
|
| 80 |
-
else:
|
| 81 |
-
worksheet.update(f'G{cell.row}', f'{hf_likes_new}')
|
| 82 |
|
| 83 |
except Exception as e:
|
| 84 |
print(f"add_exp_hub Error: {e}")
|
|
|
|
| 59 |
async def add_exp_hub(ctx, discord_user_id):
|
| 60 |
try:
|
| 61 |
cell = worksheet.find(str(discord_user_id))
|
| 62 |
+
if cell.col == 5:
|
| 63 |
+
# find hub_user_name
|
| 64 |
+
hf_user_name = worksheet.cell(cell.row, cell.col-2).value
|
| 65 |
+
if hf_user_name:
|
| 66 |
+
# check likes
|
| 67 |
+
likes = list_liked_repos(f"{hf_user_name}")
|
| 68 |
+
hf_likes_new = likes.total
|
| 69 |
+
hf_likes_old = worksheet.cell(cell.row, cell.col+2).value
|
| 70 |
+
if hf_likes_old:
|
| 71 |
+
hf_likes_old = int(hf_likes_old)
|
| 72 |
+
difference = hf_likes_new - hf_likes_old
|
| 73 |
+
if difference > 0:
|
| 74 |
+
worksheet.update(f'G{cell.row}', f'{hf_likes_new}')
|
| 75 |
+
"""
|
| 76 |
+
for i in range(difference):
|
| 77 |
+
await add_exp(discord_user_id)
|
| 78 |
+
"""
|
| 79 |
+
|
| 80 |
+
else:
|
| 81 |
worksheet.update(f'G{cell.row}', f'{hf_likes_new}')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
except Exception as e:
|
| 84 |
print(f"add_exp_hub Error: {e}")
|