Skip to content

Commit

Permalink
changed way how diff_message is generated
Browse files Browse the repository at this point in the history
  • Loading branch information
xsnowstorm committed Oct 15, 2023
1 parent ff923d0 commit 0510f1e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions bot/commands/utility/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,15 @@ async def execute(self, arguments, message) -> None:
],
capture_output=True,
).stdout.decode()
commit_diff = int(
diff_message = str(
subprocess.run(
["git", "rev-list", "--count", "HEAD..origin/main"],
["git", "status"],
capture_output=True,
)
.stdout.decode()
.strip()
.split("\n")[1]
)
diff_message = (
f"*{commit_diff} commits behind remote*"
if commit_diff
else "*Up to date with remote*"
)

embed = Embed(title="Latest commits", description=f"{diff_message}\n{commits}")
await message.channel.send(embed=embed)

0 comments on commit 0510f1e

Please sign in to comment.