This repository has been archived on 2024-01-30. You can view files and clone it, but cannot push or open issues or pull requests.
anitrox/commands/avatar.js

38 lines
951 B
JavaScript

const { Constants } = require('discord.js');
module.exports = {
name: require('path').parse(__filename).name,
description: "Gets a user's avatar.",
options: [{
name: 'user',
description: 'Another user',
required: false,
type: Constants.ApplicationCommandOptionTypes.USER
},
{
name: 'userid',
description: "Another user's ID",
required: false,
type: Constants.ApplicationCommandOptionTypes.INTEGER
}],
async execute (client, message, args, config) {
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author;
await message.channel.send({
embeds: [{
title: `:frame_photo: ${user.username}'s Beautiful Avatar!`,
color: 9442302,
footer: {
icon_url: message.author.displayAvatarURL(),
text: config.footerTxt
},
image: {
url: user.displayAvatarURL()
}
}]
});
}
};