Haha-Yes/commands/utility/avatar.js

30 lines
728 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-06-22 18:44:24 +02:00
return message.channel.send('Your avatar:', {files: [message.author.displayAvatarURL() + '?size=2048']});
2019-01-02 08:09:45 +01:00
else
2019-06-22 18:44:24 +02:00
return message.channel.send(`${args.user.username}'s avatar:`, {files: [args.user.displayAvatarURL() + '?size=2048']});
2019-01-02 08:09:45 +01:00
}
2018-12-30 01:20:24 +01:00
}
module.exports = AvatarCommand;