-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
26 lines (23 loc) · 693 Bytes
/
index.js
File metadata and controls
26 lines (23 loc) · 693 Bytes
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
const {
Client,
GatewayIntentBits
} = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
],
});
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('guildMemberAdd', async member => {
const channels = ["channel1", "channel2"]
for (const channel of channels) {
const channell = client.channels.cache.get(channel)
channell.send(`Welcome, <@${member.id}> !`).then(msg => setTimeout(() => msg.delete(), 1000));
}
});
client.login("token");