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 KfChatDotNetWsClient.Models.Events;
|
||||
|
||||
@@ -50,4 +51,21 @@ public class EnableGambaMessages : ICommand
|
||||
botInstance.BotServices.TemporarilySuppressGambaMessages = false;
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user