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

18 lines
No EOL
633 B
C#

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