Skip to content

Commit

Permalink
Added the ability to display the date and time of the latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
nishinji authored and IllusionMan1212 committed Oct 29, 2024
1 parent 85fcb27 commit 42770ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Vita3KBot/APIClients/GithubClient/GithubClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static async Task<Embed> GetLatestBuild() {

GitHubClient github = new GitHubClient(new ProductHeaderValue("Vita3KBot"));
Release latestRelease = await github.Repository.Release.Get("Vita3k", "Vita3k", "continuous");
string releaseTime = $"Published at {latestRelease.PublishedAt:u}";
ReleaseAsset windowsRelease = latestRelease.Assets.Where(release => {
return release.Name.StartsWith("windows-latest");
}).First();
Expand Down Expand Up @@ -42,7 +43,8 @@ public static async Task<Embed> GetLatestBuild() {
.WithColor(Color.Orange)
.AddField("Windows", $"[{windowsRelease.Name}]({windowsRelease.BrowserDownloadUrl})")
.AddField("Linux", $"[{linuxRelease.Name}]({linuxRelease.BrowserDownloadUrl}), [{appimageRelease.Name}]({appimageRelease.BrowserDownloadUrl})")
.AddField("Mac", $"[{macosRelease.Name}]({macosRelease.BrowserDownloadUrl})");
.AddField("Mac", $"[{macosRelease.Name}]({macosRelease.BrowserDownloadUrl})")
.WithFooter(releaseTime);

return LatestBuild.Build();
}
Expand Down

0 comments on commit 42770ff

Please sign in to comment.