Skip to content

Commit 65e239e

Browse files
committed
Deduplicate commit details legend
1 parent 63539b9 commit 65e239e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fred/libraries/createembed.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ def format_commit(commit: dict) -> tuple[str, str]:
9191
)
9292
return f"{commit_message}\n", f'{change_summary_icons} - by {attribution} {ts} [{hash_id}]({commit["url"]})\n'
9393

94+
def _append_legend_footer(embed: nextcord.Embed) -> None:
95+
embed.set_footer(text="Use the `" + config.Misc.fetch("prefix") + "legend` to learn what the icons mean!")
9496

9597
# data format: https://docs.github.com/en/webhooks/webhook-events-and-payloads#push
9698
def push(data: dict) -> nextcord.Embed:
@@ -125,7 +127,7 @@ def push(data: dict) -> nextcord.Embed:
125127
embed.add_field(name=f"{not_shown} commits not shown", value="See GitHub for more details!", inline=False)
126128

127129
embed.set_author(name=data["sender"]["login"], icon_url=data["sender"]["avatar_url"])
128-
embed.set_footer(text="Use the `" + config.Misc.fetch("prefix") + "legend` to learn what the icons mean!")
130+
_append_legend_footer(embed)
129131
return embed
130132

131133

@@ -187,9 +189,7 @@ def pull_request(data: dict) -> nextcord.Embed:
187189

188190
direction = f'{data["pull_request"]["head"]["ref"]} -> {data["pull_request"]["base"]["ref"]}'
189191
embed.add_field(name=direction, value=stats)
190-
191-
embed.set_footer(text="Use the `" + config.Misc.fetch("prefix") + "legend` to learn what the icons mean!")
192-
192+
_append_legend_footer(embed)
193193
return embed
194194

195195

0 commit comments

Comments
 (0)