royalbot.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:royal-bot-the-third 作者: Steffo99 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号