30 lines
No EOL
882 B
JavaScript
30 lines
No EOL
882 B
JavaScript
const { Command } = require('discord-akairo');
|
|
|
|
class AvatarCommand extends Command {
|
|
constructor() {
|
|
super('avatar', {
|
|
aliases: ['avatar', 'avy'],
|
|
category: 'utility',
|
|
args: [
|
|
{
|
|
id: 'user',
|
|
type: 'user'
|
|
}
|
|
],
|
|
description: {
|
|
content: 'Show avatar of the mentioned user or you',
|
|
usage: '(optional) [@user]',
|
|
examples: ['', '@user']
|
|
}
|
|
});
|
|
}
|
|
|
|
async exec(message, args) {
|
|
if (!args.user) // While these kind of statments work you really should use {}
|
|
return message.channel.send(`Your avatar:\n${message.author.displayAvatarURL}`);
|
|
else
|
|
return message.channel.send(`${args.user.username}'s avatar:\n${args.user.displayAvatarURL}`);
|
|
}
|
|
}
|
|
|
|
module.exports = AvatarCommand; |