general.py 文件源码

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

项目:MangoByte 作者: mdiller 项目源码 文件源码
def changelog(self, ctx):
        """Gets a rough changelog for mangobyte

        Note that this is a very rough changelog built from git commit messages and so will sometimes not relate directly to your perspective.

        For more commit versions or better detailed information, check out the source on [GitHub](https://github.com/mdiller/MangoByte/commits/master)
        """
        commit_url = "https://github.com/mdiller/MangoByte"
        description = f"For more information check out the [commit history]({commit_url}/commits/master) on GitHub\n"
        lines = get_changelog().split("\n")

        recent_date = 0

        for line in lines:
            if line == "":
                continue
            commit = line.split(",")
            full_sha = commit[0]
            timestamp = int(commit[1])
            small_sha = commit[2]
            message = ",".join(commit[3:])
            if timestamp > recent_date:
                recent_date = timestamp
            description += f"\n[`{small_sha}`]({commit_url}/commit/{full_sha}) {message}"

        if recent_date != 0:
            embed = discord.Embed(description=description, color=discord.Color.green(), timestamp=datetime.datetime.utcfromtimestamp(recent_date))
            embed.set_footer(text="Most recent change at")
        else:
            embed = discord.Embed(description=description, color=discord.Color.green())

        embed.set_author(name="Changelog", url=f"{commit_url}/commits/master")
        await ctx.send(embed=embed)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号