mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Updated TZ output to AGT
This commit is contained in:
@@ -7,13 +7,13 @@ namespace KfChatDotNetBot.Commands;
|
|||||||
public class TimeCommand : ICommand
|
public class TimeCommand : ICommand
|
||||||
{
|
{
|
||||||
public List<Regex> Patterns => [new Regex("^time")];
|
public List<Regex> Patterns => [new Regex("^time")];
|
||||||
public string? HelpText => "Get current time in BMT";
|
public string? HelpText => "Get current time in AGT";
|
||||||
public UserRight RequiredRight => UserRight.Guest;
|
public UserRight RequiredRight => UserRight.Guest;
|
||||||
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
|
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
|
||||||
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
|
||||||
{
|
{
|
||||||
var bmt = new DateTimeOffset(TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow,
|
var agt = new DateTimeOffset(TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow,
|
||||||
TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")), TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time").BaseUtcOffset);
|
TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")), TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time").BaseUtcOffset);
|
||||||
await botInstance.SendChatMessageAsync($"It's currently {bmt:h:mm:ss tt} BMT");
|
await botInstance.SendChatMessageAsync($"It's currently {agt:dddd h:mm:ss tt} AGT", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user