Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -79,20 +79,16 @@ def update_google_sheet():
|
|
| 79 |
try:
|
| 80 |
print("Updating...")
|
| 81 |
name = "levelbot"
|
| 82 |
-
await asyncio.sleep(1.1)
|
| 83 |
#worksheet = gspread_bot.open(name).sheet1
|
| 84 |
-
await asyncio.sleep(1.1)
|
| 85 |
global_df['discord_user_id'] = global_df['discord_user_id'].astype(str)
|
| 86 |
# could just do this / format
|
| 87 |
set_with_dataframe(worksheet, global_df)
|
| 88 |
-
await asyncio.sleep(1.1)
|
| 89 |
# very important, otherwise gspread will force format IDs in scientific notation by default (making them unusable)
|
| 90 |
worksheet.format(f"A1:A{len(global_df.index)+1}", {
|
| 91 |
"numberFormat": {
|
| 92 |
"type": 'TEXT',
|
| 93 |
},
|
| 94 |
})
|
| 95 |
-
await asyncio.sleep(1.1)
|
| 96 |
print(f"Google sheet {name} successfully updated! \n {global_df}")
|
| 97 |
except Exception as e:
|
| 98 |
print(f"on_message Error: {e}")
|
|
|
|
| 79 |
try:
|
| 80 |
print("Updating...")
|
| 81 |
name = "levelbot"
|
|
|
|
| 82 |
#worksheet = gspread_bot.open(name).sheet1
|
|
|
|
| 83 |
global_df['discord_user_id'] = global_df['discord_user_id'].astype(str)
|
| 84 |
# could just do this / format
|
| 85 |
set_with_dataframe(worksheet, global_df)
|
|
|
|
| 86 |
# very important, otherwise gspread will force format IDs in scientific notation by default (making them unusable)
|
| 87 |
worksheet.format(f"A1:A{len(global_df.index)+1}", {
|
| 88 |
"numberFormat": {
|
| 89 |
"type": 'TEXT',
|
| 90 |
},
|
| 91 |
})
|
|
|
|
| 92 |
print(f"Google sheet {name} successfully updated! \n {global_df}")
|
| 93 |
except Exception as e:
|
| 94 |
print(f"on_message Error: {e}")
|