nyx/command/Information/avatar.js

51 lines
1.2 KiB
JavaScript
Raw Normal View History

2023-04-06 12:43:44 +02:00
const {
Client,
CommandInteraction,
EmbedBuilder,
ImageFormat,
} = require("discord.js");
2021-09-06 12:38:25 +02:00
module.exports = {
name: "avatar",
description: "Show user's avatar in different formats",
usage: "{User}",
category: "Information",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
2023-04-06 02:28:29 +02:00
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/ run: async (client, interaction, args) => {
2021-09-06 12:38:25 +02:00
const member =
interaction.guild.members.cache.get(args[0]) || interaction.member;
2022-10-26 12:38:28 +02:00
const embed = new EmbedBuilder()
2022-03-02 15:37:01 +01:00
.setAuthor({
name: member.user.tag,
2022-03-02 15:37:01 +01:00
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 1024 }),
})
2021-09-06 12:38:25 +02:00
.setColor(client.color)
.setTitle(`${member.user.username}'s Avatar`)
.setImage(
2023-04-02 14:12:53 +02:00
member.user.displayAvatarURL({
size: 2048,
dynamic: true,
format: "png",
})
2021-09-06 12:38:25 +02:00
)
2022-03-02 15:37:01 +01:00
.setFooter({
text: `Made by ${client.author}`,
2023-04-02 14:12:53 +02:00
iconURL: client.user.displayAvatarURL({ dynamic: true }),
2022-03-02 15:37:01 +01:00
})
2021-09-06 12:38:25 +02:00
.setURL(client.web)
.setTimestamp();
interaction.followUp({ embeds: [embed] });
2021-09-06 12:38:25 +02:00
},
};