status_rotation.py 文件源码

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

项目:apex-sigma-plugins 作者: lu-ci 项目源码 文件源码
def status_clockwork(ev):
    while True:
        if ev.bot.cfg.pref.status_rotation:
            if not status_cache:
                status_files = ev.db[ev.db.db_cfg.database].StatusFiles.find()
                for status_file in status_files:
                    status_text = status_file.get('Text')
                    status_cache.append(status_text)
            if status_cache:
                status = status_cache.pop(secrets.randbelow(len(status_cache)))
                game = discord.Game(name=status)
                try:
                    await ev.bot.change_presence(game=game)
                except discord.ConnectionClosed:
                    pass
        await asyncio.sleep(180)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号