-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
46 lines (34 loc) · 989 Bytes
/
index.js
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
const express = require("express");
const app = express();
const Discord = require('discord.js');
app.listen(() => console.log("Server started"));
app.use('/ping', (req, res) => {
res.send(new Date());
});
const tokens =["TOKENS","TOKENS"];
console.log('Total tokens',tokens.length);
let clients=[];
for(let i=0;i<tokens.length;i++){
let client = new Discord.Client();
clients.push(client);
}
for(let i=0;i<tokens.length;i++){
clients[i].on('ready',async () => {
console.log("Starting...");
let Server = clients[i].guilds.get("SERVER ID");
let Channel = Server.channels.get("CHANNELS ID");
if(Channel.type === 'voice')
{
Channel.join();
setInterval(() => {
if(Server.me.voiceChannel && Server.me.voiceChannelID !== Channel.id || !Server.me.voiceChannel)
{
Channel.join();
}
}, 1);
} else {
console.log('Failed To Join The Channel')
}
});
clients[i].login(tokens[i]);
}