mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-30 11:09:54 +03:00
another two or three refactors
This commit is contained in:
parent
868b6bcaa7
commit
790f77aa49
21 changed files with 1447 additions and 944 deletions
|
@ -1,25 +1,19 @@
|
|||
using Discord.Commands;
|
||||
|
||||
// ReSharper disable UnusedType.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace Boyfriend.Commands;
|
||||
|
||||
public class PingCommand : Command {
|
||||
public override async Task Run(SocketCommandContext context, string[] args) {
|
||||
await context.Channel.SendMessageAsync($"{Utils.GetBeep(Boyfriend.GetGuildConfig(context.Guild).Lang!)}" +
|
||||
$"{Boyfriend.Client.Latency}{Messages.Milliseconds}");
|
||||
}
|
||||
public override string[] Aliases { get; } = {"ping", "latency", "pong", "пинг", "задержка", "понг"};
|
||||
public override int ArgsLengthRequired => 0;
|
||||
|
||||
public override List<string> GetAliases() {
|
||||
return new List<string> {"ping", "пинг", "задержка"};
|
||||
}
|
||||
public override Task Run(SocketCommandContext context, string[] args) {
|
||||
var builder = Boyfriend.StringBuilder;
|
||||
|
||||
public override int GetArgumentsAmountRequired() {
|
||||
return 0;
|
||||
}
|
||||
builder.Append(Utils.GetBeep()).Append(Boyfriend.Client.Latency).Append(Messages.Milliseconds);
|
||||
|
||||
public override string GetSummary() {
|
||||
return "Измеряет время обработки REST-запроса";
|
||||
Output(ref builder);
|
||||
builder.Clear();
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue