-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (23 loc) · 886 Bytes
/
Copy pathindex.js
File metadata and controls
30 lines (23 loc) · 886 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
27
28
29
30
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require('./config.json');
const token = process.env.token
client.login(token)
client.on("ready", () =>{
console.log("connect as " + client.user.tag +" ")
})
//Require
const insediamenti = require("./insediamenti/insediamenti")
const fazioni = require("./fazioni/fazioni")
client.on("voiceStateUpdate", (oldMember,newMember) => {
if(newMember.channel != null){
insediamenti(oldMember,newMember,client)
fazioni(oldMember,newMember,client)
}else if(oldMember.channel != null){
if(oldMember.channel.parent.id == config.parente1){
insediamenti(oldMember,newMember,client)
}else if(oldMember.channel.parent.id == config.parente2){
fazioni(oldMember,newMember,client)
}
}
})