2021-11-18 18:56:42 +01:00
|
|
|
const client = require("../");
|
2022-10-26 12:38:28 +02:00
|
|
|
const { EmbedBuilder } = require("discord.js");
|
2021-11-18 18:56:42 +01:00
|
|
|
const { Welcome } = require("../config.js");
|
2021-09-06 12:38:25 +02:00
|
|
|
client.on("guildMemberAdd", async member => {
|
|
|
|
const channel = member.guild.channels.cache.find(
|
2023-04-05 00:06:53 +02:00
|
|
|
channel => channel.id == Welcome
|
2021-09-06 12:38:25 +02:00
|
|
|
);
|
|
|
|
if (!channel) return;
|
2023-04-05 00:06:53 +02:00
|
|
|
channel.send({
|
|
|
|
embeds: [
|
|
|
|
new EmbedBuilder()
|
|
|
|
.setTitle(
|
|
|
|
`<:join:897246825122254848> Hello ${member}, Welcome to NYX's Support Server!`
|
|
|
|
)
|
|
|
|
.setThumbnail(
|
|
|
|
member.user.displayAvatarURL({ dynamic: true, size: 512 })
|
|
|
|
)
|
|
|
|
.addFields(
|
|
|
|
{
|
|
|
|
name: "Read Rules",
|
|
|
|
value: `<#799074874513555496>`,
|
|
|
|
inline: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Support Channel",
|
|
|
|
value: `<#837865823225511946>`,
|
|
|
|
inline: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "FAQ",
|
|
|
|
value: `<#897345265516822558>`,
|
|
|
|
inline: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Badge",
|
|
|
|
value: `<#897345265516822558>`,
|
|
|
|
inline: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "User ID:",
|
|
|
|
value: `\`\`\`\n${member.id}\n\`\`\``,
|
|
|
|
inline: true,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
.setFooter({
|
|
|
|
text: `${member.user.tag} joined the server!`,
|
|
|
|
iconURL: member.user.displayAvatarURL({ dynamic: true }),
|
|
|
|
})
|
|
|
|
.setColor(client.color)
|
|
|
|
.setTimestamp(),
|
|
|
|
],
|
|
|
|
});
|
2021-09-06 12:38:25 +02:00
|
|
|
});
|
|
|
|
client.on("guildMemberRemove", async member => {
|
|
|
|
const channel = member.guild.channels.cache.find(
|
2023-04-05 00:06:53 +02:00
|
|
|
channel => channel.id == Welcome
|
2021-09-06 12:38:25 +02:00
|
|
|
);
|
|
|
|
if (!channel) return;
|
2023-04-05 00:06:53 +02:00
|
|
|
channel.send({
|
|
|
|
embeds: [
|
|
|
|
new EmbedBuilder()
|
|
|
|
.setTitle(
|
|
|
|
`<:leave:897246828045680640> ${member.user.username} can't handle being cool! `
|
|
|
|
)
|
|
|
|
.setThumbnail(member.guild.iconURL({ dynamic: true }))
|
|
|
|
.setDescription(`We now only have ${member.guild.memberCount} members`)
|
|
|
|
.setFooter({
|
|
|
|
text: `${member.user.tag} left the server!`,
|
|
|
|
iconURL: member.user.displayAvatarURL({ dynamic: true }),
|
|
|
|
})
|
|
|
|
.setColor(client.color)
|
|
|
|
.setTimestamp(),
|
|
|
|
],
|
|
|
|
});
|
2021-09-06 12:38:25 +02:00
|
|
|
});
|