Add shard latency to !ping

This commit is contained in:
Dragory 2019-04-23 05:59:46 +03:00
parent 50c3c92c01
commit 7cf32d0316

View file

@ -685,6 +685,8 @@ export class UtilityPlugin extends ZeppelinPlugin<IUtilityPluginConfig> {
const lowest = Math.round(Math.min(...times)); const lowest = Math.round(Math.min(...times));
const mean = Math.round(times.reduce((t, v) => t + v, 0) / times.length); const mean = Math.round(times.reduce((t, v) => t + v, 0) / times.length);
const shard = this.bot.shards.get(this.bot.guildShardMap[this.guildId]);
msg.channel.createMessage( msg.channel.createMessage(
trimLines(` trimLines(`
**Ping:** **Ping:**
@ -692,6 +694,7 @@ export class UtilityPlugin extends ZeppelinPlugin<IUtilityPluginConfig> {
Highest: **${highest}ms** Highest: **${highest}ms**
Mean: **${mean}ms** Mean: **${mean}ms**
Time between ping command and first reply: **${msgToMsgDelay}ms** Time between ping command and first reply: **${msgToMsgDelay}ms**
Shard latency: **${shard.latency}ms**
`), `),
); );