Haha-Yes/commands/utility/avatar.js
2019-05-11 19:46:53 +02:00

30 lines
No EOL
726 B
JavaScript

const { Command } = require('discord-akairo');
class AvatarCommand extends Command {
constructor() {
super('avatar', {
aliases: ['avatar', 'avy'],
category: 'utility',
args: [
{
id: 'user',
type: 'member'
}
],
description: {
content: 'Show avatar of the mentioned user or you',
usage: '(optional) [@user]',
examples: ['', '@user', 'username']
}
});
}
async exec(message, args) {
if (!args.user)
return message.channel.send('Your avatar:', {files: [message.author.displayAvatarURL('png', '2048')]});
else
return message.channel.send(`${args.user.username}'s avatar:`, {files: [args.user.displayAvatarURL('png', '2048')]});
}
}
module.exports = AvatarCommand;