owner.py 文件源码

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

项目:nya-chan-bot 作者: OSAlt 项目源码 文件源码
def update(self, ctx, args='default'):
        """Updates bot."""
        try:
            branch = self.config.git_branch if args == 'default' else args
            # Retrieving latest code from upstream.
            process1 = subprocess.check_output("git fetch".format(branch), stderr=subprocess.STDOUT,
                                               shell=True)
            process = subprocess.check_output("git checkout origin/{}".format(branch), stderr=subprocess.STDOUT,
                                              shell=True)
            await ctx.author.send("```Git pull from '{}' success```".format(branch))
        except Exception as e:
            await ctx.author.send("```py\nError while git pulling\n```")
            raise commands.UserInputError(ctx)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号