hi guys How can I show when the user entered the server in the embed?

hi guys How can I show when the user entered the server in the embed?
19 Replies
d.js toolkit
d.js toolkit11mo 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! - Marked as resolved by staff
chewie
chewie11mo ago
use the guildMemberAdd event, you need the Guilds and GuildMembers intents for that
Ctrl+Z
Ctrl+ZOP11mo ago
{ name: 'joined at' , value: ${member.guildMemberAdd.toDateString()}}, Cannot read properties of undefined (reading 'toDateString')@chewie 🌈
const { ActionRowBuilder, ButtonBuilder, EmbedBuilder, ButtonStyle, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const client = require('../../index')
const db = require('pro.db');
const Discord = require('discord.js')

module.exports = {
name: 'user',
description: 'معرفة معلومات الشخص',
options: [{
name: 'username',
description: 'يوزر الشخص',
type: 6,
required: false
},],


async execute(client, interaction) {

let member = interaction.options.getUser('username');
if (!member) {
member = interaction.user;
}
let embed = new EmbedBuilder()
.setTitle(`معلومات: ${member.username}`)
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 4096 }))
.setFields(
{ name: 'الدخول الى الدسكورد' , value:`${member.createdAt.toDateString()}`},

{ name: 'joined at' , value: `${member.guildMemberAdd.toDateString()}`},
)
.setFooter({ text:` بطلب من: ${interaction.user.username}` , iconURL: interaction.user.avatarURL() })

interaction.reply({ embeds: [embed] });
}
}
const { ActionRowBuilder, ButtonBuilder, EmbedBuilder, ButtonStyle, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const client = require('../../index')
const db = require('pro.db');
const Discord = require('discord.js')

module.exports = {
name: 'user',
description: 'معرفة معلومات الشخص',
options: [{
name: 'username',
description: 'يوزر الشخص',
type: 6,
required: false
},],


async execute(client, interaction) {

let member = interaction.options.getUser('username');
if (!member) {
member = interaction.user;
}
let embed = new EmbedBuilder()
.setTitle(`معلومات: ${member.username}`)
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 4096 }))
.setFields(
{ name: 'الدخول الى الدسكورد' , value:`${member.createdAt.toDateString()}`},

{ name: 'joined at' , value: `${member.guildMemberAdd.toDateString()}`},
)
.setFooter({ text:` بطلب من: ${interaction.user.username}` , iconURL: interaction.user.avatarURL() })

interaction.reply({ embeds: [embed] });
}
}
full code
chewie
chewie11mo ago
oh you mean it like that sorry, use member.joinedAt But you defined member as a user so use getMember instead of getUser and use member.user.createdAt for the date when the account was created
Ctrl+Z
Ctrl+ZOP11mo ago
Cannot read properties of undefined (reading 'joinedAt')
const { ActionRowBuilder, ButtonBuilder, EmbedBuilder, ButtonStyle, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const client = require('../../index')
const db = require('pro.db');
const Discord = require('discord.js')

module.exports = {
name: 'user',
description: 'معرفة معلومات الشخص',
options: [{
name: 'username',
description: 'يوزر الشخص',
type: 6,
required: false
},],


async execute(client, interaction) {

let member = interaction.options.getUser('username');
if (!member) {
member = interaction.user;
}
let embed = new EmbedBuilder()
.setTitle(`معلومات: ${member.username}`)
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 4096 }))
.setFields(
{ name: 'الدخول الى الدسكورد' , value:`${member.createdAt.toDateString()}`},

{ name: 'joined at' , value: `${member.member.joinedAt}`},
)
.setFooter({ text:` بطلب من: ${interaction.user.username}` , iconURL: interaction.user.avatarURL() })

interaction.reply({ embeds: [embed] });
}
}
const { ActionRowBuilder, ButtonBuilder, EmbedBuilder, ButtonStyle, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const client = require('../../index')
const db = require('pro.db');
const Discord = require('discord.js')

module.exports = {
name: 'user',
description: 'معرفة معلومات الشخص',
options: [{
name: 'username',
description: 'يوزر الشخص',
type: 6,
required: false
},],


async execute(client, interaction) {

let member = interaction.options.getUser('username');
if (!member) {
member = interaction.user;
}
let embed = new EmbedBuilder()
.setTitle(`معلومات: ${member.username}`)
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 4096 }))
.setFields(
{ name: 'الدخول الى الدسكورد' , value:`${member.createdAt.toDateString()}`},

{ name: 'joined at' , value: `${member.member.joinedAt}`},
)
.setFooter({ text:` بطلب من: ${interaction.user.username}` , iconURL: interaction.user.avatarURL() })

interaction.reply({ embeds: [embed] });
}
}
@chewie 🌈
chewie
chewie11mo ago
thats not even close to what I told you to do please read again and you dont need to ping me every time
Ctrl+Z
Ctrl+ZOP11mo ago
im sorry
const { ActionRowBuilder, ButtonBuilder, EmbedBuilder, ButtonStyle, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const client = require('../../index')
const db = require('pro.db');
const Discord = require('discord.js')

module.exports = {
name: 'user',
description: 'معرفة معلومات الشخص',
options: [{
name: 'username',
description: 'يوزر الشخص',
type: 6,
required: false
},],


async execute(client, interaction) {

let member = interaction.options.getMember('username');
if (!member) {
member = interaction.user;
}
let embed = new EmbedBuilder()
.setTitle(`معلومات: ${member.username}`)
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 4096 }))
.setFields(
{ name: 'الدخول الى الدسكورد' , value:`${member.user.createdAt}`},

{ name: 'joined at' , value: `${member.user.joinedAt}`}
)
.setFooter({ text:` بطلب من: ${interaction.user.username}` , iconURL: interaction.user.avatarURL() })

interaction.reply({ embeds: [embed] });
}
}
const { ActionRowBuilder, ButtonBuilder, EmbedBuilder, ButtonStyle, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const client = require('../../index')
const db = require('pro.db');
const Discord = require('discord.js')

module.exports = {
name: 'user',
description: 'معرفة معلومات الشخص',
options: [{
name: 'username',
description: 'يوزر الشخص',
type: 6,
required: false
},],


async execute(client, interaction) {

let member = interaction.options.getMember('username');
if (!member) {
member = interaction.user;
}
let embed = new EmbedBuilder()
.setTitle(`معلومات: ${member.username}`)
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 4096 }))
.setFields(
{ name: 'الدخول الى الدسكورد' , value:`${member.user.createdAt}`},

{ name: 'joined at' , value: `${member.user.joinedAt}`}
)
.setFooter({ text:` بطلب من: ${interaction.user.username}` , iconURL: interaction.user.avatarURL() })

interaction.reply({ embeds: [embed] });
}
}
thats okay Cannot read properties of undefined (reading 'joinedAt')
chewie
chewie11mo ago
no, its still member.joinedAt
Ctrl+Z
Ctrl+ZOP11mo ago
Cannot read properties of undefined (reading 'createdAt') can you edit on it I didn't understand you
chewie
chewie11mo ago
man I didn't tell you to change the createdAt field that was already fine
Ctrl+Z
Ctrl+ZOP11mo ago
ok
chewie
chewie11mo ago
member.user.createdAt member.joinedAt
Ctrl+Z
Ctrl+ZOP11mo ago
1s
Ctrl+Z
Ctrl+ZOP11mo ago
No description
Ctrl+Z
Ctrl+ZOP11mo ago
const { ActionRowBuilder, ButtonBuilder, EmbedBuilder, ButtonStyle, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const client = require('../../index')
const db = require('pro.db');
const Discord = require('discord.js')

module.exports = {
name: 'user',
description: 'معرفة معلومات الشخص',
options: [{
name: 'username',
description: 'يوزر الشخص',
type: 6,
required: false
},],


async execute(client, interaction) {

let member = interaction.options.getMember('username');
if (!member) {
member = interaction.user;
}
let embed = new EmbedBuilder()
.setTitle(`معلومات: ${member.username}`)
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 4096 }))
.setFields(
{ name: 'الدخول الى الدسكورد' , value:`${member.createdAt.toDateString()}`},

{ name: 'joined at' , value: `${member.joinedAt}`}
)
.setFooter({ text:` بطلب من: ${interaction.user.username}` , iconURL: interaction.user.avatarURL() })

interaction.reply({ embeds: [embed] });
}
}
const { ActionRowBuilder, ButtonBuilder, EmbedBuilder, ButtonStyle, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const client = require('../../index')
const db = require('pro.db');
const Discord = require('discord.js')

module.exports = {
name: 'user',
description: 'معرفة معلومات الشخص',
options: [{
name: 'username',
description: 'يوزر الشخص',
type: 6,
required: false
},],


async execute(client, interaction) {

let member = interaction.options.getMember('username');
if (!member) {
member = interaction.user;
}
let embed = new EmbedBuilder()
.setTitle(`معلومات: ${member.username}`)
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 4096 }))
.setFields(
{ name: 'الدخول الى الدسكورد' , value:`${member.createdAt.toDateString()}`},

{ name: 'joined at' , value: `${member.joinedAt}`}
)
.setFooter({ text:` بطلب من: ${interaction.user.username}` , iconURL: interaction.user.avatarURL() })

interaction.reply({ embeds: [embed] });
}
}
join at undefined
chewie
chewie11mo ago
did you provide a member in the command option or did you leave it empty let member = interaction.options.getMember('username'); if (!member) { member = interaction.user; } that should be interaction.member, not user
Ctrl+Z
Ctrl+ZOP11mo ago
No description
Ctrl+Z
Ctrl+ZOP11mo ago
same I solved the problem Thank you
Mutrax ¯\_(ツ)_/¯
if problem is solved then pls press "mark post as solved". top of chat
Want results from more Discord servers?
Add your server