mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Added git versioning to stamp assemblies with the commit and a command that might work to retrieve the commit hash
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Reflection;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using KfChatDotNetBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using KfChatDotNetWsClient.Models.Events;
|
using KfChatDotNetWsClient.Models.Events;
|
||||||
|
|
||||||
@@ -50,4 +51,21 @@ public class EnableGambaMessages : ICommand
|
|||||||
botInstance.BotServices.TemporarilySuppressGambaMessages = false;
|
botInstance.BotServices.TemporarilySuppressGambaMessages = false;
|
||||||
await botInstance.SendChatMessageAsync("Gamba notifs back on the menu", true);
|
await botInstance.SendChatMessageAsync("Gamba notifs back on the menu", true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetVersionCommand : ICommand
|
||||||
|
{
|
||||||
|
public List<Regex> Patterns => [
|
||||||
|
new Regex("^version$")
|
||||||
|
];
|
||||||
|
|
||||||
|
public string? HelpText => null;
|
||||||
|
public UserRight RequiredRight => UserRight.Loser;
|
||||||
|
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
|
||||||
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
|
||||||
|
{
|
||||||
|
var version = Assembly.GetEntryAssembly()
|
||||||
|
.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
|
||||||
|
await botInstance.SendChatMessageAsync($"Bot compiled against {version.Split('+')[1]}", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,10 @@
|
|||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.4" />
|
||||||
|
<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="NLog" Version="5.4.0" />
|
<PackageReference Include="NLog" Version="5.4.0" />
|
||||||
<PackageReference Include="Raffinert.FuzzySharp" Version="2.0.3" />
|
<PackageReference Include="Raffinert.FuzzySharp" Version="2.0.3" />
|
||||||
<PackageReference Include="System.Runtime.Caching" Version="9.0.4" />
|
<PackageReference Include="System.Runtime.Caching" Version="9.0.4" />
|
||||||
|
|||||||
Reference in New Issue
Block a user