forked from Supositware/Haha-Yes
made it shorter
This commit is contained in:
parent
8d271be6a3
commit
841b70f2b2
1 changed files with 15 additions and 8 deletions
|
@ -6,16 +6,23 @@ module.exports = class AvatarCommand extends Command {
|
||||||
group: 'utility',
|
group: 'utility',
|
||||||
memberName: 'avatar',
|
memberName: 'avatar',
|
||||||
description: 'Send the avatar of the mentionned user.',
|
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) {
|
async run(message, { user }) {
|
||||||
if (!message.mentions.users.size)
|
if (!user)
|
||||||
return message.channel.send(`Your avatar: ${message.author.displayAvatarURL}`);
|
return message.say(`Your avatar:\n${message.author.displayAvatarURL}`);
|
||||||
|
else
|
||||||
const avatarList = message.mentions.users.map(user => {
|
return message.say(`${user.username}'s avatar:\n${user.displayAvatarURL}`);
|
||||||
return `${user.username}'s avatar: ${user.displayAvatarURL}`;
|
|
||||||
});
|
|
||||||
message.channel.send(avatarList);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
Loading…
Reference in a new issue