.ping command added

This commit is contained in:
Kwoth 2017-04-03 12:43:59 +02:00
parent 510a466985
commit d0380b0cbf
2 changed files with 21 additions and 0 deletions

View File

@ -16,6 +16,7 @@ using System.Collections.Generic;
using Newtonsoft.Json;
using Discord.WebSocket;
using NadekoBot.Services;
using System.Diagnostics;
namespace NadekoBot.Modules.Utility
{
@ -494,5 +495,16 @@ namespace NadekoBot.Modules.Utility
await Context.User.SendFileAsync(
await JsonConvert.SerializeObject(grouping, Formatting.Indented).ToStream().ConfigureAwait(false), title, title).ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task Ping()
{
var sw = Stopwatch.StartNew();
var msg = await Context.Channel.SendMessageAsync("🏓").ConfigureAwait(false);
sw.Stop();
msg.DeleteAfter(0);
await Context.Channel.SendConfirmAsync($"{Format.Bold(Context.User.ToString())} 🏓 {(int)sw.Elapsed.TotalMilliseconds}ms").ConfigureAwait(false);
}
}
}

View File

@ -3330,6 +3330,15 @@
<data name="claimpatreonrewards_usage" xml:space="preserve">
<value>`{0}claimpatreonrewards`</value>
</data>
<data name="ping_cmd" xml:space="preserve">
<value>ping</value>
</data>
<data name="ping_desc" xml:space="preserve">
<value>Ping the bot to see if there are latency issues.</value>
</data>
<data name="ping_usage" xml:space="preserve">
<value>`{0}ping`</value>
</data>
<data name="slowmodewhitelist_cmd" xml:space="preserve">
<value>slowmodewl</value>
</data>