mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-30 11:09:54 +03:00
Async message handling, CommandHandler rewrite and rename
This commit is contained in:
parent
53f13d88a5
commit
ac63719a0b
19 changed files with 1061 additions and 711 deletions
|
@ -1,17 +1,16 @@
|
|||
using Discord.Commands;
|
||||
|
||||
namespace Boyfriend.Commands;
|
||||
namespace Boyfriend.Commands;
|
||||
|
||||
public class PingCommand : Command {
|
||||
public override string[] Aliases { get; } = {"ping", "latency", "pong", "пинг", "задержка", "понг"};
|
||||
public override int ArgsLengthRequired => 0;
|
||||
public override string[] Aliases { get; } = { "ping", "latency", "pong", "пинг", "задержка", "понг" };
|
||||
|
||||
public override Task Run(SocketCommandContext context, string[] args) {
|
||||
public override Task Run(CommandProcessor cmd, string[] args) {
|
||||
var builder = Boyfriend.StringBuilder;
|
||||
|
||||
builder.Append(Utils.GetBeep()).Append(Boyfriend.Client.Latency).Append(Messages.Milliseconds);
|
||||
builder.Append(Utils.GetBeep())
|
||||
.Append(Math.Abs(DateTimeOffset.Now.Subtract(cmd.Context.Message.Timestamp).TotalMilliseconds))
|
||||
.Append(Messages.Milliseconds);
|
||||
|
||||
Output(ref builder);
|
||||
cmd.Reply(builder.ToString(), ":signal_strength: ");
|
||||
builder.Clear();
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue