Haha-Yes/commands/utility/avatar.js

30 lines
819 B
JavaScript
Raw Normal View History

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) {
if (!args.user)
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;