2018-12-30 01:20:24 +01:00
|
|
|
const { Command } = require('discord-akairo');
|
2018-12-05 00:52:21 +01:00
|
|
|
|
2018-12-30 01:20:24 +01:00
|
|
|
class AvatarCommand extends Command {
|
|
|
|
constructor() {
|
|
|
|
super('avatar', {
|
|
|
|
aliases: ['avatar', 'avy'],
|
|
|
|
category: 'utility',
|
2018-11-01 22:08:49 +01:00
|
|
|
args: [
|
|
|
|
{
|
2018-12-30 01:20:24 +01:00
|
|
|
id: 'user',
|
|
|
|
type: 'user'
|
2018-11-01 22:08:49 +01:00
|
|
|
}
|
2018-12-30 01:20:24 +01:00
|
|
|
],
|
|
|
|
description: {
|
|
|
|
content: 'Show avatar of the mentioned user or you',
|
|
|
|
usage: '(optional) [@user]',
|
|
|
|
examples: ['', '@user']
|
|
|
|
}
|
2018-09-07 19:07:10 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-12-30 01:20:24 +01:00
|
|
|
async exec(message, args) {
|
2019-01-02 04:35:34 +01:00
|
|
|
if (!args.user) // While these kind of statments work you really should use {}
|
2018-12-30 01:20:24 +01:00
|
|
|
return message.channel.send(`Your avatar:\n${message.author.displayAvatarURL}`);
|
2018-10-13 15:36:01 +02:00
|
|
|
else
|
2018-12-30 01:20:24 +01:00
|
|
|
return message.channel.send(`${args.user.username}'s avatar:\n${args.user.displayAvatarURL}`);
|
2018-09-07 19:07:10 +02:00
|
|
|
}
|
2018-12-30 01:20:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = AvatarCommand;
|