-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathshard.js
59 lines (40 loc) · 1.37 KB
/
shard.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
47
48
49
50
51
52
53
54
55
56
57
58
59
// const { ShardingManager } = require('discord.js');
// const config = require('./JSON/config.json')
// let manager = new ShardingManager('./AIOBot.js', {
// token: config.token,
// totalShards: 02,
// });
// manager.on('shardCreate', shard => {
// console.log(`[Shards]: Lauched shard ${shard.id}`)
// })
// manager.spawn();
// const { ShardingManager } = require("discord.js")
// const config = require('./JSON/config.json')
// let manager = new ShardingManager('./AIOBot.js', {
// // token: config.token,
// // totalShards: 4,
// autoSpawn: config.sharding.autoSpawn,
// respawn: config.sharding.respawn,
// totalShards: config.sharding.shardsNumber,
// token: login.discord.token
// })
// manager.on('shardCreate', shard => {
// console.log(`[SHARDS]: Launched shard ${shard.id}`)
// })
// manager.spawn();
// console.clear()
const config = require('./JSON/config.json')
const { ShardingManager } = require('discord.js');
const ascii = require('ascii-table');
let table = new ascii("Shard status");
table.setHeading("Id", "Status");
const manager = new ShardingManager('./AIOBot.js', {
token: config.token,
totalShards: 4,
mode: "process"
});
manager.spawn(manager.totalShards, 10000);
manager.on('shardCreate', async (shard) => {
table.addRow(shard.id, `Launched shard #${shard.id}`)
console.log(table.toString());
});