Format numbers, style changes, fixes

This commit is contained in:
Daniel Odendahl Jr
2018-10-13 02:28:07 +00:00
parent 5c2c9d25a5
commit b0780575be
45 changed files with 146 additions and 159 deletions
+4 -3
View File
@@ -2,6 +2,7 @@ const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const moment = require('moment');
require('moment-duration-format');
const { formatNumber } = require('../../util/Util');
const { version, dependencies } = require('../../package');
const { XIAO_GITHUB_REPO_USERNAME, XIAO_GITHUB_REPO_NAME } = process.env;
const source = XIAO_GITHUB_REPO_NAME && XIAO_GITHUB_REPO_USERNAME;
@@ -23,9 +24,9 @@ module.exports = class InfoCommand extends Command {
const embed = new MessageEmbed()
.setColor(0x00AE86)
.setFooter('©2017-2018 dragonfire535#8081')
.addField(' Servers', this.client.guilds.size, true)
.addField(' Shards', this.client.options.shardCount, true)
.addField(' Commands', this.client.registry.commands.size, true)
.addField(' Servers', formatNumber(this.client.guilds.size), true)
.addField(' Shards', formatNumber(this.client.options.shardCount), true)
.addField(' Commands', formatNumber(this.client.registry.commands.size), true)
.addField(' Home Server', this.client.options.invite ? `[Here](${this.client.options.invite})` : 'None', true)
.addField(' Source Code',
source ? `[Here](https://github.com/${XIAO_GITHUB_REPO_USERNAME}/${XIAO_GITHUB_REPO_NAME})` : 'N/A', true)
+3 -2
View File
@@ -1,5 +1,6 @@
const Command = require('../../structures/Command');
const { stripIndents } = require('common-tags');
const { formatNumber } = require('../../util/Util');
module.exports = class PingCommand extends Command {
constructor(client) {
@@ -17,8 +18,8 @@ module.exports = class PingCommand extends Command {
const message = await msg.say('Pinging...');
const ping = Math.round(message.createdTimestamp - msg.createdTimestamp);
return message.edit(stripIndents`
🏓 P${'o'.repeat(Math.ceil(ping / 100))}ng! \`${ping}ms\`
Heartbeat: \`${Math.round(this.client.ping)}ms\`
🏓 P${'o'.repeat(Math.min(Math.round(ping / 100), 1500))}ng! \`${formatNumber(ping)}ms\`
Heartbeat: \`${formatNumber(Math.round(this.client.ping))}ms\`
`);
}
};