-
Notifications
You must be signed in to change notification settings - Fork 1
/
play_connect_4.js
38 lines (36 loc) · 1.55 KB
/
play_connect_4.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
const { ShardingManager } = require('discord.js')
const request = require('request')
const manager = new ShardingManager(`${__dirname}/play_connect_4_bots.js`, { totalShards: 3 })
manager.on('launch', shard => {
console.log(`Successfully launched shard ${shard.id}`)
})
manager.spawn()
setInterval(function(){
manager.fetchClientValues('guilds.size').then(results => {
var number_serv = results.reduce((prev, val) => prev + val, 0)
request.post({
url: 'https://bots.discord.pw/api/bots/321278762773643265/stats',
headers: {
'Content-Type': 'application/json',
'Authorization': '[key here]'
},
body: '{"server_count":'+number_serv+'}'
}, function (error, response, body){})
request.post({
url: 'https://discordbots.org/api/bots/321278762773643265/stats',
headers: {
'Content-Type': 'application/json',
'Authorization': '[key here]'
},
body: '{"server_count":'+number_serv+'}'
}, function (error, response, body){})
request.post({
url: 'https://list.passthemayo.space/api/bots/321278762773643265',
headers: {
'Content-Type': 'application/json',
'Authorization': '[key here]'
},
body: '{"server_count":'+number_serv+'}'
}, function (error, response, body){})
}).catch(console.error);
}, 30000)