Repository navigation
Expand file tree
/
Copy pathindex.js
More file actions
77 lines (61 loc) · 1.84 KB
/
Copy pathindex.js
File metadata and controls
77 lines (61 loc) · 1.84 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const { KeepAlive } = require("./keep_alive")
require("dotenv").config();
const {
Client,
GatewayIntentBits,
EmbedBuilder
} = require("discord.js");
const config = require("./config");
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers
]
});
const statuses = [
"🌐 WEB • EN PROCESO",
"⭐ IP SYSTEM • EN PROCESO",
"🛒 TIENDA • EN PROCESO",
];
client.once("ready", () => {
console.log(`✅ Bot listo como ${client.user.tag}`);
// 🔥 STATUS DEL BOT
let i = 0;
client.user.setActivity(statuses[i], { type: 0 });
setInterval(() => {
i = (i + 1) % statuses.length;
client.user.setActivity(statuses[i], { type: 0 });
}, 5000);
});
client.on("guildMemberAdd", async (member) => {
// 🟣 AUTOROL
try {
const rol = member.guild.roles.cache.get(config.rolAuto);
if (rol) await member.roles.add(rol);
} catch (error) {
console.log("❌ Error en autorol:", error);
}
// 🟢 BIENVENIDA PRO
const canal = member.guild.channels.cache.get(config.canalBienvenida);
if (!canal) return;
const embed = new EmbedBuilder()
.setColor("#FBD43C")
.setAuthor({
name: `Bienvenido/a a ${member.guild.name}`
})
.setDescription(
`Antes de iniciar tu proceso, revisa la información del servidor:
📌 **ENLACES OFICIALES**
> 📢 <#${config.canales.anuncios}>
> 📜 <#${config.canales.normas}>
> 📌 <#${config.canales.info}>
Una vez leído, podrás continuar correctamente.
👤 Usuario: ${member}
🆔 ID: ${member.id}`
)
.setThumbnail(member.user.displayAvatarURL({ dynamic: true }))
.setFooter({ text: "𝗔𝗱𝗺𝗶𝗻𝗶𝘀𝘁𝗿𝗮𝗰𝗶𝗼́𝗻 | 𝗦𝘁𝗲𝗹𝗮𝗿𝗠𝗖 𝗡𝗲𝘁𝘄𝗼𝗿𝗸" })
.setTimestamp();
canal.send({ embeds: [embed] });
});
client.login(process.env.TOKEN);