Animated emoji, npm fix

This commit is contained in:
Daniel Odendahl Jr
2017-12-31 22:48:48 +00:00
parent d2e9bfbf3e
commit 0933c8f318
6 changed files with 24 additions and 9 deletions
+18 -4
View File
@@ -8,12 +8,26 @@ module.exports = class EmojiListCommand extends Command {
group: 'info',
memberName: 'emoji-list',
description: 'Responds with a list of the server\'s custom emoji.',
guildOnly: true
guildOnly: true,
args: [
{
key: 'type',
prompt: 'Would you like to view animated emoji or regular emoji?',
type: 'string',
default: 'regular',
validate: type => {
if (['animated', 'regular'].includes(type.toLowerCase())) return true;
return 'Invalid type, please enter either animated or regular.';
},
parse: type => type.toLowerCase()
}
]
});
}
run(msg) {
if (!msg.guild.emojis.size) return msg.say('This server has no custom emoji.');
return msg.say(msg.guild.emojis.map(emoji => emoji.toString()).join(''));
run(msg, { type }) {
const emojis = msg.guild.emojis.filter(emoji => type === 'animated' ? emoji.animated : !emoji.animated);
if (!emojis.size) return msg.say(`This server has no ${type} custom emoji.`);
return msg.say(emojis.map(emoji => emoji.toString()).join(' '), { split: { char: ' ' } });
}
};
+2 -2
View File
@@ -31,8 +31,8 @@ module.exports = class EmojiInfoCommand extends Command {
emoji.id, true)
.addField(' Creation Date',
emoji.createdAt.toDateString(), true)
.addField(' External?',
emoji.managed ? 'Yes' : 'No', true);
.addField(' Animated?',
emoji.animated ? 'Yes' : 'No', true);
return msg.embed(embed);
}
};