1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-19 16:33:36 +03:00

Use ThisAssembly.Git.RepositoryUrl

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2024-03-17 23:49:17 +03:00
parent 847c3211a0
commit 8cbcd84536
Signed by: mctaylors
GPG key ID: 7181BEBE676903C1
4 changed files with 9 additions and 12 deletions

View file

@ -96,30 +96,30 @@ public class AboutCommandGroup : CommandGroup
builder.AppendBulletPointLine($"{tag} — {$"AboutDeveloper@{dev.Username}".Localized()}");
}
var footer = ThisAssembly.Git.IsDirty
? $"{ThisAssembly.Git.Branch}-{ThisAssembly.Git.Commit}-dirty"
: $"{ThisAssembly.Git.Branch}-{ThisAssembly.Git.Commit}";
var embed = new EmbedBuilder()
.WithSmallTitle(string.Format(Messages.AboutBot, bot.Username), bot)
.WithDescription(builder.ToString())
.WithColour(ColorsList.Cyan)
.WithImageUrl("https://i.ibb.co/fS6wZhh/octobot-banner.png")
.WithFooter(string.Format(Messages.Version, footer))
.WithFooter(string.Format(Messages.Version, ThisAssembly.Git.IsDirty
? $"{ThisAssembly.Git.Branch}-{ThisAssembly.Git.Commit}-dirty"
// ReSharper disable once HeuristicUnreachableCode
// ^^^ while being reachable, however
: $"{ThisAssembly.Git.Branch}-{ThisAssembly.Git.Commit}"))
.Build();
var repositoryButton = new ButtonComponent(
ButtonComponentStyle.Link,
Messages.ButtonOpenRepository,
new PartialEmoji(Name: "🌐"),
URL: Octobot.RepositoryUrl
URL: ThisAssembly.Git.RepositoryUrl
);
var issuesButton = new ButtonComponent(
ButtonComponentStyle.Link,
Messages.ButtonReportIssue,
new PartialEmoji(Name: "⚠️"),
URL: Octobot.IssuesUrl
URL: $"{ThisAssembly.Git.RepositoryUrl}/issues"
);
return await _feedback.SendContextualEmbedResultAsync(embed,

View file

@ -72,7 +72,7 @@ public class ErrorLoggingPostExecutionEvent : IPostExecutionEvent
ButtonComponentStyle.Link,
Messages.ButtonReportIssue,
new PartialEmoji(Name: "⚠️"),
URL: Octobot.IssuesUrl
URL: $"{ThisAssembly.Git.RepositoryUrl}/issues"
);
return await _feedback.SendContextualEmbedResultAsync(embed,

View file

@ -22,9 +22,6 @@ namespace Octobot;
public sealed class Octobot
{
public const string RepositoryUrl = "https://github.com/TeamOctolings/Octobot";
public const string IssuesUrl = $"{RepositoryUrl}/issues";
public static readonly AllowedMentions NoMentions = new(
Array.Empty<MentionType>(), Array.Empty<Snowflake>(), Array.Empty<Snowflake>());

View file

@ -117,7 +117,7 @@ public class GuildLoadedResponder : IResponder<IGuildCreate>
ButtonComponentStyle.Link,
Messages.ButtonReportIssue,
new PartialEmoji(Name: "⚠️"),
URL: Octobot.IssuesUrl
URL: $"{ThisAssembly.Git.RepositoryUrl}/issues"
);
return await _channelApi.CreateMessageWithEmbedResultAsync(channel, embedResult: errorEmbed,