JaBa/commands/General/avatar.c.js

47 lines
969 B
JavaScript
Raw Normal View History

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
*/
constructor() {
super({
command: new ContextMenuCommandBuilder()
2023-11-19 22:43:17 +05:00
.setName("Get Avatar")
.setType(ApplicationCommandType.User)
.setDMPermission(false),
aliases: [],
dirname: __dirname,
ownerOnly: false,
});
}
/**
*
2023-11-05 16:03:23 +05:00
* @param {import("../../base/Client")} client
*/
async onLoad() {
//...
}
/**
*
2023-11-05 16:03:23 +05:00
* @param {import("../../base/Client")} client
* @param {import("discord.js").UserContextMenuCommandInteraction} interaction
* @param {Object} data
*/
async execute(client, interaction) {
const avatar = interaction.targetUser.avatarURL({ size: 2048 });
interaction.reply({
files: [
{
attachment: avatar,
},
],
});
}
}
module.exports = AvatarContext;