Skip to content

Commit 16ba4ba

Browse files
committed
Git embed commit info: Display "author" details instead of "committer".
With previous behavior, rebases make it look like the rebaser was the person who made every commit.
1 parent 65e239e commit 16ba4ba

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

fred/libraries/createembed.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def DM(text: str) -> nextcord.Embed:
8383
def format_commit(commit: dict) -> tuple[str, str]:
8484
hash_id = f'`{commit["id"][:8]}`'
8585
commit_message = commit["message"].split("\n")[0].replace("*", r"\*")
86-
author = commit["committer"]
86+
author = commit["author"]
8787
attribution = f'[{author["name"]}](https://github.com/{author["username"]})'
8888
ts = timestamp(commit["timestamp"])
8989
change_summary_icons = " ".join(
@@ -126,6 +126,8 @@ def push(data: dict) -> nextcord.Embed:
126126
if not_shown := len(commits[24:]):
127127
embed.add_field(name=f"{not_shown} commits not shown", value="See GitHub for more details!", inline=False)
128128

129+
# Note: if we wanted to get user display name instead of username,
130+
# looks like we'd have to web request the `url` field then use the `name` field from the response
129131
embed.set_author(name=data["sender"]["login"], icon_url=data["sender"]["avatar_url"])
130132
_append_legend_footer(embed)
131133
return embed

0 commit comments

Comments
 (0)