shorten in Util

This commit is contained in:
Daniel Odendahl Jr
2017-08-22 21:01:08 +00:00
parent 05e45fbb79
commit 1938b65786
14 changed files with 31 additions and 22 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch');
const moment = require('moment');
const { shorten } = require('../../structures/Util');
module.exports = class NPMCommand extends Command {
constructor(client) {
@@ -45,7 +46,7 @@ module.exports = class NPMCommand extends Command {
.addField(' Main File',
body.versions[body['dist-tags'].latest].main, true)
.addField(' Keywords',
body.keywords && body.keywords.length ? body.keywords.join(', ').substr(0, 1024) : 'None')
body.keywords && body.keywords.length ? shorten(body.keywords.join(', '), 1000) : 'None')
.addField(' Maintainers',
body.maintainers.map(user => user.name).join(', '));
return msg.embed(embed);