Haha-Yes/commands/utility/avatar.js

30 lines
724 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 {
2019-01-02 08:09:45 +01:00
constructor() {
super('avatar', {
aliases: ['avatar', 'avy'],
category: 'utility',
args: [
{
id: 'user',
type: 'user'
2019-01-02 08:09:45 +01:00
}
],
description: {
2018-12-30 01:20:24 +01:00
content: 'Show avatar of the mentioned user or you',
usage: '(optional) [@user]',
2019-05-11 19:46:53 +02:00
examples: ['', '@user', 'username']
2018-12-30 01:20:24 +01:00
}
2019-01-02 08:09:45 +01:00
});
}
2018-09-07 19:07:10 +02:00
2019-01-02 08:09:45 +01:00
async exec(message, args) {
2019-01-02 18:45:53 +01:00
if (!args.user)
2019-02-13 15:47:46 +01:00
return message.channel.send('Your avatar:', {files: [message.author.displayAvatarURL('png', '2048')]});
2019-01-02 08:09:45 +01:00
else
2019-02-13 15:47:46 +01:00
return message.channel.send(`${args.user.username}'s avatar:`, {files: [args.user.displayAvatarURL('png', '2048')]});
2019-01-02 08:09:45 +01:00
}
2018-12-30 01:20:24 +01:00
}
module.exports = AvatarCommand;