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
+2 -2
View File
@@ -1,7 +1,7 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const request = require('node-superfetch');
const { shorten } = require('../../util/Util');
const { shorten, formatNumber } = require('../../util/Util');
const { GOOGLE_KEY } = process.env;
module.exports = class GoogleBookCommand extends Command {
@@ -44,7 +44,7 @@ module.exports = class GoogleBookCommand extends Command {
.setThumbnail(data.imageLinks ? data.imageLinks.thumbnail : null)
.addField(' Authors', data.authors.length ? data.authors.join(', ') : '???')
.addField(' Publish Date', data.publishedDate || '???', true)
.addField(' Page Count', data.pageCount || '???', true)
.addField(' Page Count', data.pageCount ? formatNumber(data.pageCount) : '???', true)
.addField(' Genres', data.categories.length ? data.categories.join(', ') : '???');
return msg.embed(embed);
} catch (err) {