-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
40 lines (32 loc) · 1.48 KB
/
Copy pathindex.js
File metadata and controls
40 lines (32 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const { Client, GatewayIntentBits, EmbedBuilder } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
]
});
client.once('ready', () => {
console.log(`✅ البوت مسجل باسم: ${client.user.tag}`);
});
client.on('guildMemberAdd', async (member) => {
const welcomeChannelId = '1531582749763440740';
const channel = member.guild.channels.cache.get(welcomeChannelId);
if (!channel) return;
// الحصول على رابط الصورة بشكل نظيف
const avatarUrl = member.user.displayAvatarURL({ extension: 'png', forceStatic: false, size: 256 });
const welcomeEmbed = new EmbedBuilder()
.setColor('#0099ff')
.setTitle('عضو جديد انضم! 🎉')
// النص هنا نضيف تماماً ومافيهوش أي متغير للصورة
.setDescription(`أهلاً بك ${member} في السيرفر!\nنورتنا يا غالي ❤️`)
.addFields(
{ name: '👥 عدد الأعضاء:', value: `${member.guild.memberCount}`, inline: true }
)
// الصورة هتنحط هنا بس على الجنب من غير ما تظهر كـ رابط
.setThumbnail(avatarUrl)
.setTimestamp()
.setFooter({ text: member.guild.name, iconURL: member.guild.iconURL() });
channel.send({ embeds: [welcomeEmbed] });
});
client.login(process.env.TOKEN);