def job_updatelol(singletimeout=1, alltimeout=1800):
await d.client.wait_until_ready()
while True:
# Open a new database session
session = database.Session()
# Query all the LoL accounts
users = session.query(database.LoL).all()
# Update all the users' stats
for user in users:
updates = await user.update_data()
if updates:
# Send some info to Discord
await d.client.send_message(d.client.get_channel(247426005537390592), "Account aggiornato!", embed=user.generate_discord_embed())
await asyncio.sleep(singletimeout)
session.commit()
await asyncio.sleep(alltimeout)
评论列表
文章目录