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)
评论列表
文章目录