Why can't I click to view the user profile?

- My code:
module.exports = async function welcomeMember(member) {
try {
const fetchedMember = await member.guild.members.fetch(member.id);

const welcomeChannel = member.guild.channels.cache.get(process.env.WELCOME_CHANNEL_ID);
if (welcomeChannel) {
const welcomeMessage = `ยินดีต้อนรับ\n<@${fetchedMember.id}>`;

const welcomeEmbed = {
color: 0x00ff00,
title: 'เข้าสู่เซิร์ฟเวอร์',
description: welcomeMessage,
thumbnail: {
url: fetchedMember.user.displayAvatarURL()
},
timestamp: new Date(),
author: {
name: member.guild.name,
icon_url: member.guild.iconURL({ dynamic: true })
}
};
await welcomeChannel.send({ embeds: [welcomeEmbed] });
} else {
console.error('ไม่พบช่องประกาศที่ระบุ');
}
} catch (error) {
console.error(`ไม่สามารถส่งข้อความต้อนรับสำหรับ ${member.user.tag}`, error);
}
}
module.exports = async function welcomeMember(member) {
try {
const fetchedMember = await member.guild.members.fetch(member.id);

const welcomeChannel = member.guild.channels.cache.get(process.env.WELCOME_CHANNEL_ID);
if (welcomeChannel) {
const welcomeMessage = `ยินดีต้อนรับ\n<@${fetchedMember.id}>`;

const welcomeEmbed = {
color: 0x00ff00,
title: 'เข้าสู่เซิร์ฟเวอร์',
description: welcomeMessage,
thumbnail: {
url: fetchedMember.user.displayAvatarURL()
},
timestamp: new Date(),
author: {
name: member.guild.name,
icon_url: member.guild.iconURL({ dynamic: true })
}
};
await welcomeChannel.send({ embeds: [welcomeEmbed] });
} else {
console.error('ไม่พบช่องประกาศที่ระบุ');
}
} catch (error) {
console.error(`ไม่สามารถส่งข้อความต้อนรับสำหรับ ${member.user.tag}`, error);
}
}
Can anyone help me fix this problem? The member is still on my server.
No description
4 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
treble/luna
treble/luna3mo ago
the user isnt cached in your discord client, nothing djs can do about
Mr.Earng™
Mr.Earng™OP3mo ago
I tried MEE6 bots and they don't have this problem. How did they do it?
treble/luna
treble/luna3mo ago
this is because your discord client doesnt have the user cached Nothing a bot can do about you just happened to have that user cached
Want results from more Discord servers?
Add your server