AeThex-Bot-Master/aethex-bot/commands/avatar.js
sirpiglr ca07d17417 Add new commands and improve bot functionality
Introduce several new slash commands including ban, kick, timeout, and userinfo. Enhance existing commands like config and rank with new features and configurations. Add new listeners for welcome and goodbye messages. Implement XP tracking for user leveling and integrate it with role rewards. Update documentation to reflect these changes.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 1be8d824-5029-4875-bed8-0bd1d810892d
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/SQxsvtx
Replit-Helium-Checkpoint-Created: true
2025-12-08 04:09:56 +00:00

36 lines
1.2 KiB
JavaScript

const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('avatar')
.setDescription('Get a user\'s avatar')
.addUserOption(option =>
option.setName('user')
.setDescription('User to get avatar of (defaults to yourself)')
.setRequired(false)
),
async execute(interaction, supabase, client) {
const target = interaction.options.getUser('user') || interaction.user;
const sizes = [128, 256, 512, 1024, 2048];
const links = sizes.map(size =>
`[${size}](${target.displayAvatarURL({ size, extension: 'png' })})`
).join(' | ');
const embed = new EmbedBuilder()
.setColor(0x7c3aed)
.setTitle(`${target.tag}'s Avatar`)
.setDescription(`Download: ${links}`)
.setImage(target.displayAvatarURL({ size: 1024, extension: 'png' }))
.setTimestamp();
const member = await interaction.guild.members.fetch(target.id).catch(() => null);
if (member && member.avatar) {
embed.setThumbnail(member.displayAvatarURL({ size: 256 }));
embed.setFooter({ text: 'Thumbnail shows server-specific avatar' });
}
await interaction.reply({ embeds: [embed] });
},
};