2022-12-06 21:06:39 -06:00
|
|
|
const { ApplicationCommandOptionType } = require('discord.js');
|
2022-04-21 20:53:03 -05:00
|
|
|
|
2022-03-26 03:33:18 -05:00
|
|
|
module.exports = {
|
2022-03-26 03:58:15 -05:00
|
|
|
|
2022-04-18 11:25:40 -05:00
|
|
|
name: require('path').parse(__filename).name,
|
2022-03-26 03:33:18 -05:00
|
|
|
description: "Gets a user's avatar.",
|
2022-04-21 20:53:03 -05:00
|
|
|
options: [{
|
|
|
|
name: 'user',
|
|
|
|
description: 'Another user',
|
|
|
|
required: false,
|
2022-12-06 21:06:39 -06:00
|
|
|
type: ApplicationCommandOptionType.User
|
2022-04-21 20:53:03 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'userid',
|
|
|
|
description: "Another user's ID",
|
|
|
|
required: false,
|
2022-12-06 21:06:39 -06:00
|
|
|
type: ApplicationCommandOptionType.User
|
2022-04-21 20:53:03 -05:00
|
|
|
}],
|
2022-04-18 11:25:40 -05:00
|
|
|
|
2022-04-21 23:44:02 -05:00
|
|
|
async parseMessage (client, config, message, args) {
|
|
|
|
const target = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author;
|
|
|
|
await message.channel.send(this.handle(client, config, message.author, target));
|
|
|
|
},
|
|
|
|
|
|
|
|
async parseInteraction (client, config, interaction) {
|
|
|
|
const target = interaction.options.getUser('user') || client.users.cache.get(interaction.options.getString('userid')) || interaction.user;
|
|
|
|
await interaction.reply(this.handle(client, config, interaction.user, target));
|
|
|
|
},
|
2022-04-21 18:09:21 -05:00
|
|
|
|
2022-04-21 23:44:02 -05:00
|
|
|
handle (_, config, user, target) {
|
|
|
|
return {
|
2022-04-21 18:09:21 -05:00
|
|
|
embeds: [{
|
2022-12-26 16:22:44 -06:00
|
|
|
title: `:frame_photo: ${target.username}'s Beautiful Profile Picture!`,
|
|
|
|
description: `[Profile picture link (Mobile users, tap here!)](${target.displayAvatarURL({ dynamic: true })})`,
|
2022-04-21 18:09:21 -05:00
|
|
|
color: 9442302,
|
2022-12-26 16:22:44 -06:00
|
|
|
image: { url: target.displayAvatarURL({ dynamic: true }) },
|
|
|
|
footer: { icon_url: user.displayAvatarURL(), text: config.footerTxt }
|
|
|
|
|
2022-04-21 18:09:21 -05:00
|
|
|
}]
|
2022-04-21 23:44:02 -05:00
|
|
|
};
|
2022-03-26 03:33:18 -05:00
|
|
|
}
|
2022-04-21 18:09:21 -05:00
|
|
|
};
|