1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 17:19:00 +03:00
Octobot/Boyfriend/Commands/PingCommand.cs

19 lines
654 B
C#
Raw Normal View History

namespace Boyfriend.Commands;
public sealed class PingCommand : ICommand {
public string[] Aliases { get; } = { "ping", "latency", "pong", "пинг", "задержка", "понг" };
public Task RunAsync(CommandProcessor cmd, string[] args, string[] cleanArgs) {
2022-05-14 16:12:24 +03:00
var builder = Boyfriend.StringBuilder;
builder.Append(Utils.GetBeep())
.Append(Math.Round(Math.Abs(DateTimeOffset.Now.Subtract(cmd.Context.Message.Timestamp).TotalMilliseconds)))
.Append(Messages.Milliseconds);
2022-05-14 16:12:24 +03:00
cmd.Reply(builder.ToString(), ReplyEmojis.Ping);
2022-05-14 16:12:24 +03:00
builder.Clear();
2022-05-14 16:12:24 +03:00
return Task.CompletedTask;
}
}