cmdcommands.py 文件源码

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

项目:PTSCogs 作者: PlanetTeamSpeakk 项目源码 文件源码
def on_ready(self):
        self.emptycogLoaded = os.path.exists('data/cmdcommands/emptycog.py')
        if not self.emptycogLoaded:
            print('Emptycog.py was not found, trying to download')
            try:
                async with aiohttp.get("https://raw.githubusercontent.com/PlanetTeamSpeakk/PTSCogs-attributes/master/emptycog.py") as r:
                    emptycog = await r.content.read()
                with open('data/cmdcommands/emptycog.py','wb') as f:
                    f.write(emptycog)
                print('Succesfully downloaded emptycog.py')
            except Exception as e:
                print(e)
                print("Error occured, did not download emptycog.py, go to https://raw.githubusercontent.com/PlanetTeamSpeakk/PTSCogs/master/emptycog.py press ctrl+s and save it in the data/cmdcommands/ folder.")
        else:
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号