This repository was archived by the owner on Aug 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
92 lines (90 loc) · 4.15 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// @ts-check
const chalk = require('chalk');
console.log("Welcome to HT-IndexScript by HammerTechnik\n\nThis is the NovaJS Booter, please answer all given questions to continue,\nif you have questions to given questions,\nopen a ticket here: https://discord.gg/BSuJSJa")
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('Run Mode?\n[default|sharding]', (answer) => {
//rl.close();
//process.emitWarning("index.js:10:13", "OUT_OF_BOUNDS")
switch (answer.trim()) {
case "default": {
rl.question('Login Token?\n[default|custom]', (answers) => {
//rl.close(); enable for disable-ing smth custom token server
switch (answers.trim()) {
case "default": {
let NovaJS = require('./Nova.js')
let token = "Token"
let db = "Host"
rl.question('Enable Beta Mode?\n[true|false]', (answers) => {
rl.close();
switch (answers.trim()) {
case "false": {
NovaJS.index(token, db, false)
break
}
case "true": {
NovaJS.index(token, db, true)
break
}
default: {
console.log(`That's not a valid answer! | ${answers.trim()}`)
setTimeout(() => { process.exit() }, 3000)
}
}
})
break
}
case "custom": {
//return console.log("not supported yet!")
console.log("be sure the looginserver is filled in")
let fs = require('fs')
var config = JSON.parse(fs.readFileSync('./loginserver', 'utf8'))
let NovaJS = require('./Nova.js')
if (config.type != "private") console.log("public db's are not supported yet")
rl.question('Enable Beta Mode?\n[true|false]', (answers) => {
rl.close();
switch (answers.trim()) {
case "false": {
NovaJS.index(config.token, config.url, false)
break
}
case "true": {
NovaJS.index(config.token, config.url, true)
break
}
default: {
console.log(`That's not a valid answer! | ${answers.trim()}`)
setTimeout(() => { process.exit() }, 3000)
}
}
})
break
}
default: {
console.log(`That's not a valid answer! | ${answers.trim()}`)
setTimeout(() => { process.exit() }, 3000)
}
}
})
break
}
case "sharding": {
return console.log("not supported yet!")
rl.close()
const { ShardingManager } = require('discord.js');
// @ts-ignore
const config = require('./storage/config.json');
const manager = new ShardingManager('./runNova.js', { token: config.token.main });
manager.spawn();
manager.on('launch', shard => console.log(`Launched shard ${shard.id}`));
break
}
default: {
console.log(`That's not a valid answer! | ${answer.trim()}`)
setTimeout(() => { process.exit() }, 3000)
}
}
})