2023-11-04 16:56:10 +05:00
|
|
|
const { ContextMenuCommandBuilder, ApplicationCommandType } = require("discord.js");
|
|
|
|
const BaseCommand = require("../../base/BaseCommand");
|
|
|
|
|
|
|
|
class AvatarContext extends BaseCommand {
|
|
|
|
/**
|
|
|
|
*
|
2023-11-05 16:03:23 +05:00
|
|
|
* @param {import("../../base/Client")} client
|
2023-11-04 16:56:10 +05:00
|
|
|
*/
|
|
|
|
constructor() {
|
|
|
|
super({
|
|
|
|
command: new ContextMenuCommandBuilder()
|
2023-11-19 22:43:17 +05:00
|
|
|
.setName("Get Avatar")
|
2023-11-04 16:56:10 +05:00
|
|
|
.setType(ApplicationCommandType.User)
|
|
|
|
.setDMPermission(false),
|
|
|
|
dirname: __dirname,
|
|
|
|
ownerOnly: false,
|
|
|
|
});
|
|
|
|
}
|
2024-02-06 21:45:53 +05:00
|
|
|
|
2023-11-04 16:56:10 +05:00
|
|
|
/**
|
|
|
|
*
|
2023-11-05 16:03:23 +05:00
|
|
|
* @param {import("../../base/Client")} client
|
2023-11-04 16:56:10 +05:00
|
|
|
* @param {import("discord.js").UserContextMenuCommandInteraction} interaction
|
|
|
|
* @param {Object} data
|
|
|
|
*/
|
|
|
|
async execute(client, interaction) {
|
2024-02-06 21:45:53 +05:00
|
|
|
const avatarURL = interaction.targetUser.avatarURL({ size: 2048 });
|
|
|
|
const embed = client.embed({ image: avatarURL });
|
2023-11-04 16:56:10 +05:00
|
|
|
|
|
|
|
interaction.reply({
|
2024-02-06 21:45:53 +05:00
|
|
|
embeds: [embed],
|
2023-11-04 16:56:10 +05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = AvatarContext;
|