This repository has been archived on 2024-06-23. You can view files and clone it, but cannot push or open issues or pull requests.
OctobotStealth/Commands/PingCommand.cs
2023-04-27 22:14:30 +05:00

19 lines
674 B
C#

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