Renamed the bot from KickBot -> ChatBot and removed the reference to Kick in the project name

This commit is contained in:
barelyprofessional
2024-07-26 16:50:39 +08:00
parent f4db00246a
commit f9d87220d2
46 changed files with 84 additions and 84 deletions

View File

@@ -0,0 +1,20 @@
using System.Text.RegularExpressions;
using KfChatDotNetBot.Models.DbModels;
using KfChatDotNetWsClient.Models.Events;
namespace KfChatDotNetBot.Commands;
public class TimeCommand : ICommand
{
public List<Regex> Patterns => [new Regex("^time")];
public string HelpText => "Get current time in BMT";
public bool HideFromHelp => false;
public UserRight RequiredRight => UserRight.Guest;
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
{
var bmt = new DateTimeOffset(TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow,
TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")), TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time").BaseUtcOffset);
botInstance.SendChatMessage($"It's currently {bmt:h:mm:ss tt} BMT");
}
}