Files
xiao/commands/user-info/avatar.js
T
Daniel Odendahl Jr 1c9ac56831 Change arg assignment
2017-09-16 01:44:44 +00:00

31 lines
695 B
JavaScript

const Command = require('../../structures/Command');
module.exports = class AvatarCommand extends Command {
constructor(client) {
super(client, {
name: 'avatar',
group: 'user-info',
memberName: 'avatar',
description: 'Responds with a link to a user\'s avatar.',
args: [
{
key: 'user',
prompt: 'Which user would you like to get the avatar of?',
type: 'user',
default: ''
}
]
});
}
run(msg, { user }) {
if (!user) user = msg.author;
if (!user.avatar) return msg.say('This user has no avatar.');
const avatar = user.avatarURL({
format: user.avatar.startsWith('a_') ? 'gif' : 'png',
size: 2048
});
return msg.say(avatar);
}
};