Sort emoji by name

This commit is contained in:
Daniel Odendahl Jr
2018-09-07 11:00:40 +00:00
parent 2b0fe4bb80
commit d70e66d18e
+2 -2
View File
@@ -25,8 +25,8 @@ module.exports = class EmojiListCommand extends Command {
}
run(msg, { type }) {
const emojis = msg.guild.emojis.filter(emoji => type === 'animated' ? emoji.animated : !emoji.animated).sort();
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: ' ' } });
return msg.say(emojis.map(emoji => emoji.toString()).sort().join(' '), { split: { char: ' ' } });
}
};