Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
automate hub sheet updating
Browse files
app.py
CHANGED
|
@@ -57,6 +57,7 @@ def calculate_xp(level):
|
|
| 57 |
# check xp record presence (done in add_exp)
|
| 58 |
# check discord_user_id is verified
|
| 59 |
# do add_exp for hub?
|
|
|
|
| 60 |
@bot.command(name='add_exp_hub')
|
| 61 |
async def add_exp_hub(ctx):
|
| 62 |
try:
|
|
@@ -78,16 +79,21 @@ async def add_exp_hub(ctx):
|
|
| 78 |
|
| 79 |
except Exception as e:
|
| 80 |
print(f"add_exp_hub Error: {e}")
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
|
| 83 |
-
processed_users = set()
|
| 84 |
|
| 85 |
|
|
|
|
| 86 |
@bot.command(name='api_test')
|
| 87 |
async def api_test(ctx):
|
| 88 |
while True:
|
| 89 |
await periodic_api_test()
|
| 90 |
await asyncio.sleep(60) # Sleep for 60 seconds
|
|
|
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
async def periodic_api_test():
|
|
@@ -123,13 +129,15 @@ async def periodic_api_test():
|
|
| 123 |
except Exception as e:
|
| 124 |
print(f"periodic_api_test Error: {e}")
|
| 125 |
|
| 126 |
-
|
| 127 |
@bot.command(name='get_cell_value')
|
| 128 |
async def get_cell_value(ctx, row, col):
|
| 129 |
cell = worksheet2.cell(row, col)
|
| 130 |
print(cell.value)
|
|
|
|
| 131 |
|
| 132 |
|
|
|
|
| 133 |
@bot.command(name='check')
|
| 134 |
async def check(ctx):
|
| 135 |
try:
|
|
@@ -142,6 +150,8 @@ async def check(ctx):
|
|
| 142 |
|
| 143 |
except Exception as e:
|
| 144 |
print(f"add_exp_hub Error: {e}")
|
|
|
|
|
|
|
| 145 |
|
| 146 |
|
| 147 |
async def add_exp(member_id):
|
|
@@ -218,6 +228,7 @@ async def on_message(message):
|
|
| 218 |
try:
|
| 219 |
if message.author.id not in bot_ids:
|
| 220 |
await add_exp(message.author.id)
|
|
|
|
| 221 |
await bot.process_commands(message)
|
| 222 |
except Exception as e:
|
| 223 |
print(f"on_message Error: {e}")
|
|
|
|
| 57 |
# check xp record presence (done in add_exp)
|
| 58 |
# check discord_user_id is verified
|
| 59 |
# do add_exp for hub?
|
| 60 |
+
"""
|
| 61 |
@bot.command(name='add_exp_hub')
|
| 62 |
async def add_exp_hub(ctx):
|
| 63 |
try:
|
|
|
|
| 79 |
|
| 80 |
except Exception as e:
|
| 81 |
print(f"add_exp_hub Error: {e}")
|
| 82 |
+
"""
|
| 83 |
+
|
| 84 |
+
|
| 85 |
|
| 86 |
|
|
|
|
| 87 |
|
| 88 |
|
| 89 |
+
"""
|
| 90 |
@bot.command(name='api_test')
|
| 91 |
async def api_test(ctx):
|
| 92 |
while True:
|
| 93 |
await periodic_api_test()
|
| 94 |
await asyncio.sleep(60) # Sleep for 60 seconds
|
| 95 |
+
"""
|
| 96 |
+
processed_users = set()
|
| 97 |
|
| 98 |
|
| 99 |
async def periodic_api_test():
|
|
|
|
| 129 |
except Exception as e:
|
| 130 |
print(f"periodic_api_test Error: {e}")
|
| 131 |
|
| 132 |
+
"""
|
| 133 |
@bot.command(name='get_cell_value')
|
| 134 |
async def get_cell_value(ctx, row, col):
|
| 135 |
cell = worksheet2.cell(row, col)
|
| 136 |
print(cell.value)
|
| 137 |
+
"""
|
| 138 |
|
| 139 |
|
| 140 |
+
"""
|
| 141 |
@bot.command(name='check')
|
| 142 |
async def check(ctx):
|
| 143 |
try:
|
|
|
|
| 150 |
|
| 151 |
except Exception as e:
|
| 152 |
print(f"add_exp_hub Error: {e}")
|
| 153 |
+
"""
|
| 154 |
+
|
| 155 |
|
| 156 |
|
| 157 |
async def add_exp(member_id):
|
|
|
|
| 228 |
try:
|
| 229 |
if message.author.id not in bot_ids:
|
| 230 |
await add_exp(message.author.id)
|
| 231 |
+
await periodic_api_test()
|
| 232 |
await bot.process_commands(message)
|
| 233 |
except Exception as e:
|
| 234 |
print(f"on_message Error: {e}")
|