From 841b70f2b21a0bbee303eddd1202e429bcac408e Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 13 Oct 2018 15:36:01 +0200 Subject: [PATCH] made it shorter --- commands/utility/avatar.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/commands/utility/avatar.js b/commands/utility/avatar.js index 8c261ef8..68eeeb90 100644 --- a/commands/utility/avatar.js +++ b/commands/utility/avatar.js @@ -6,16 +6,23 @@ module.exports = class AvatarCommand extends Command { group: 'utility', memberName: 'avatar', description: 'Send the avatar of the mentionned user.', + memberName: 'say', + description: `Repeat the text you send`, + args: [ + { + key: 'user', + prompt: 'What do you want me to say', + type: 'user', + default: '' + } + ] }); } - async run(message) { - if (!message.mentions.users.size) - return message.channel.send(`Your avatar: ${message.author.displayAvatarURL}`); - - const avatarList = message.mentions.users.map(user => { - return `${user.username}'s avatar: ${user.displayAvatarURL}`; - }); - message.channel.send(avatarList); + async run(message, { user }) { + if (!user) + return message.say(`Your avatar:\n${message.author.displayAvatarURL}`); + else + return message.say(`${user.username}'s avatar:\n${user.displayAvatarURL}`); } }; \ No newline at end of file