module.exports = {
data: new SlashCommandBuilder()
.setName("유저정보")
.setDescription("유저를 지정하여 정보를 확인할 수 있습니다.")
.addUserOption(option =>
option
.setName('유저')
.setDescription('정보를 확인할 유저를 선택해주세요')),
async execute(interaction) {
// 유저 정보를 가져옵니다.
const user = interaction.options.getUser('유저');
let bot;
// 사용자가 봇인지 확인합니다.
if (user.bot === true) {
bot = "로봇 입니다 🤖";
} else {
bot = "사람 입니다 😀";
}
// 배너를 가져오는 부분 수정
let bannerURL = user.bannerURL({ dynamic: true, size: 512 });
if (!bannerURL) {
// 배너가 없을 경우 기본 이미지를 사용합니다.
bannerURL = 'https://i0.wp.com/arenaoftech.com/wp-content/uploads/2023/03/62a07b53139aec4c1fd07771_discord.webp?fit=1140%2C620&ssl=1';
}
// Embed을 생성합니다.
const embed = new EmbedBuilder()
.setTitle(`${user.username} 님의 유저정보`)
.setColor(user.accentColor || "Green")
.setThumbnail(user.displayAvatarURL({ dynamic: true }))
.setImage(user.bannerURL({ dynamic: true, size: 512 }))
.addFields(
{ name: "유저", value: `${user}**#${user.discriminator}**` },
{ name: "🆔│아이디", value: `**${user.id}**` },
{ name: "🧬│계정 유형", value: `**${bot}**` },
{
name: "뱃지",
value: `**${user.flags.toArray().join(", ") || "없음"}**`
},
);
// 유저 정보를 응답으로 보냅니다.
await interaction.reply({ embeds: [embed] });
},
};
이런식으로 작성 했는데 계속 기본 이미지만 가져오고 있는 상황입니다..
불러오는 중...