mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-19 16:33:36 +03:00
uhhh ehhh
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
d10bf3377c
commit
a5a3eb86dd
5 changed files with 61 additions and 14 deletions
|
@ -17,14 +17,12 @@
|
||||||
<NeutralLanguage>en</NeutralLanguage>
|
<NeutralLanguage>en</NeutralLanguage>
|
||||||
<Description>A general-purpose Discord bot for moderation written in C#</Description>
|
<Description>A general-purpose Discord bot for moderation written in C#</Description>
|
||||||
<ApplicationIcon>docs/octobot.ico</ApplicationIcon>
|
<ApplicationIcon>docs/octobot.ico</ApplicationIcon>
|
||||||
|
<GitVersion>false</GitVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DiffPlex" Version="1.7.2" />
|
<PackageReference Include="DiffPlex" Version="1.7.2" />
|
||||||
<PackageReference Include="GitInfo" Version="3.3.4">
|
<PackageReference Include="GitInfo" Version="3.3.4" />
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Humanizer.Core.ru" Version="2.14.1" />
|
<PackageReference Include="Humanizer.Core.ru" Version="2.14.1" />
|
||||||
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
|
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
|
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
|
||||||
|
|
54
src/BuildInfo.cs
Normal file
54
src/BuildInfo.cs
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
|
||||||
|
namespace Octobot;
|
||||||
|
|
||||||
|
public static class BuildInfo
|
||||||
|
{
|
||||||
|
public static string RepositoryUrl
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ThisAssembly.Git.RepositoryUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Issues
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return $"{RepositoryUrl}/issues";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string Commit
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ThisAssembly.Git.Commit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string Branch
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ThisAssembly.Git.Branch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsDirty
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ThisAssembly.Git.IsDirty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Version
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return IsDirty ? $"{Branch}-{Commit}-dirty" : $"{Branch}-{Commit}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -101,26 +101,21 @@ public class AboutCommandGroup : CommandGroup
|
||||||
.WithDescription(builder.ToString())
|
.WithDescription(builder.ToString())
|
||||||
.WithColour(ColorsList.Cyan)
|
.WithColour(ColorsList.Cyan)
|
||||||
.WithImageUrl("https://i.ibb.co/fS6wZhh/octobot-banner.png")
|
.WithImageUrl("https://i.ibb.co/fS6wZhh/octobot-banner.png")
|
||||||
// ThisAssembly.Git.IsDirty already returns true or false.
|
.WithFooter(string.Format(Messages.Version, BuildInfo.Version))
|
||||||
// ReSharper disable HeuristicUnreachableCode
|
|
||||||
.WithFooter(string.Format(Messages.Version, ThisAssembly.Git.IsDirty
|
|
||||||
? $"{ThisAssembly.Git.Branch}-{ThisAssembly.Git.Commit}-dirty"
|
|
||||||
: $"{ThisAssembly.Git.Branch}-{ThisAssembly.Git.Commit}"))
|
|
||||||
// ReSharper restore HeuristicUnreachableCode
|
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
var repositoryButton = new ButtonComponent(
|
var repositoryButton = new ButtonComponent(
|
||||||
ButtonComponentStyle.Link,
|
ButtonComponentStyle.Link,
|
||||||
Messages.ButtonOpenRepository,
|
Messages.ButtonOpenRepository,
|
||||||
new PartialEmoji(Name: "🌐"),
|
new PartialEmoji(Name: "🌐"),
|
||||||
URL: ThisAssembly.Git.RepositoryUrl
|
URL: BuildInfo.RepositoryUrl
|
||||||
);
|
);
|
||||||
|
|
||||||
var issuesButton = new ButtonComponent(
|
var issuesButton = new ButtonComponent(
|
||||||
ButtonComponentStyle.Link,
|
ButtonComponentStyle.Link,
|
||||||
Messages.ButtonReportIssue,
|
Messages.ButtonReportIssue,
|
||||||
new PartialEmoji(Name: "⚠️"),
|
new PartialEmoji(Name: "⚠️"),
|
||||||
URL: $"{ThisAssembly.Git.RepositoryUrl}/issues"
|
URL: BuildInfo.Issues
|
||||||
);
|
);
|
||||||
|
|
||||||
return await _feedback.SendContextualEmbedResultAsync(embed,
|
return await _feedback.SendContextualEmbedResultAsync(embed,
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class ErrorLoggingPostExecutionEvent : IPostExecutionEvent
|
||||||
ButtonComponentStyle.Link,
|
ButtonComponentStyle.Link,
|
||||||
Messages.ButtonReportIssue,
|
Messages.ButtonReportIssue,
|
||||||
new PartialEmoji(Name: "⚠️"),
|
new PartialEmoji(Name: "⚠️"),
|
||||||
URL: $"{ThisAssembly.Git.RepositoryUrl}/issues"
|
URL: BuildInfo.Issues
|
||||||
);
|
);
|
||||||
|
|
||||||
return await _feedback.SendContextualEmbedResultAsync(embed,
|
return await _feedback.SendContextualEmbedResultAsync(embed,
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class GuildLoadedResponder : IResponder<IGuildCreate>
|
||||||
ButtonComponentStyle.Link,
|
ButtonComponentStyle.Link,
|
||||||
Messages.ButtonReportIssue,
|
Messages.ButtonReportIssue,
|
||||||
new PartialEmoji(Name: "⚠️"),
|
new PartialEmoji(Name: "⚠️"),
|
||||||
URL: $"{ThisAssembly.Git.RepositoryUrl}/issues"
|
URL: BuildInfo.Issues
|
||||||
);
|
);
|
||||||
|
|
||||||
return await _channelApi.CreateMessageWithEmbedResultAsync(channel, embedResult: errorEmbed,
|
return await _channelApi.CreateMessageWithEmbedResultAsync(channel, embedResult: errorEmbed,
|
||||||
|
|
Loading…
Add table
Reference in a new issue