nz_os_5.0x-unstable 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/configuration.js +18 -0
- package/docs/How-to-5.0 +44 -0
- package/docs/Welcome-To-5.0 +8 -0
- package/package.json +19 -0
- package/system/args/MainAPI.js +22 -0
- package/system/args/MutiAPI.js +22 -0
- package/system/args/runtime.js +22 -0
- package/system/discord/_BotObjs.js +163 -0
- package/system/main/_Catcher.js +28 -0
- package/system/starter.js +3 -0
- package/windows.api.js +2 -0
package/configuration.js
ADDED
package/docs/How-to-5.0
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
How to use 5.0
|
2
|
+
|
3
|
+
Go to ./configuration.js and you will see this
|
4
|
+
|
5
|
+
```
|
6
|
+
const C = {
|
7
|
+
user: {
|
8
|
+
Username: "John Doe",
|
9
|
+
Password: "",
|
10
|
+
Port: 200
|
11
|
+
},
|
12
|
+
bots: {
|
13
|
+
token1: "",
|
14
|
+
mainbot: true,
|
15
|
+
token2: "",
|
16
|
+
secbot: false,
|
17
|
+
token3: "",
|
18
|
+
thirdbot: false
|
19
|
+
}
|
20
|
+
}
|
21
|
+
module.exports = {
|
22
|
+
C
|
23
|
+
}
|
24
|
+
```
|
25
|
+
|
26
|
+
in this pick a user name and password.
|
27
|
+
|
28
|
+
and also do not change the port.
|
29
|
+
|
30
|
+
in this section
|
31
|
+
|
32
|
+
```
|
33
|
+
bots: {
|
34
|
+
token1: "",
|
35
|
+
mainbot: true,
|
36
|
+
token2: "",
|
37
|
+
secbot: false,
|
38
|
+
token3: "",
|
39
|
+
thirdbot: false
|
40
|
+
}
|
41
|
+
```
|
42
|
+
Fill in the mainbots token and leave it true ths will be your primary bot.
|
43
|
+
|
44
|
+
then open terminal in the same folder then do npm run StartSyatem
|
package/package.json
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"name": "nz_os_5.0x-unstable",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "",
|
5
|
+
"main": "module.list.js",
|
6
|
+
"scripts": {
|
7
|
+
"StartSystem": "node ./system/starter.js"
|
8
|
+
},
|
9
|
+
"author": ".LuicdZay#9999",
|
10
|
+
"license": "ISC",
|
11
|
+
"dependencies": {
|
12
|
+
"discord.js": "^14.3.0",
|
13
|
+
"fetch": "^1.1.0",
|
14
|
+
"mysql": "^2.18.1",
|
15
|
+
"node-fetch": "^3.2.10",
|
16
|
+
"nodemon": "^2.0.20",
|
17
|
+
"request": "^2.88.2"
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
const pingMainAPI = ()=>{
|
2
|
+
const request = require('request')
|
3
|
+
const fs = require('fs')
|
4
|
+
if(!fs.existsSync('./req_logs/')){
|
5
|
+
fs.mkdirSync('./req_logs/')
|
6
|
+
}
|
7
|
+
request({
|
8
|
+
url:"https://putinproductions.000webhostapp.com/api/MainApi/MainApi.json",
|
9
|
+
json: true
|
10
|
+
}, (err,res,body)=>{
|
11
|
+
if(err){
|
12
|
+
throw err
|
13
|
+
}else{
|
14
|
+
fs.writeFileSync('./req_logs/sys.request-Main.json', `{"sys.runtime.loggedName": "${res.body.Name}", "sys.request.Port": "200","sys.server.return":"${res.rawHeaders}"}`);
|
15
|
+
console.log(`Shell: `)
|
16
|
+
console.log(res.body);
|
17
|
+
}
|
18
|
+
})
|
19
|
+
}
|
20
|
+
module.exports = {
|
21
|
+
pingMainAPI
|
22
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
const pingMultiAPI = ()=>{
|
2
|
+
const request = require('request')
|
3
|
+
const fs = require('fs')
|
4
|
+
if(!fs.existsSync('./req_logs/')){
|
5
|
+
fs.mkdirSync('./req_logs/')
|
6
|
+
}
|
7
|
+
request({
|
8
|
+
url:"https://putinproductions.000webhostapp.com/api/MutiApi/MutiAPI.json",
|
9
|
+
json: true
|
10
|
+
}, (err,res,body)=>{
|
11
|
+
if(err){
|
12
|
+
throw err
|
13
|
+
}else{
|
14
|
+
fs.writeFileSync('./req_logs/sys.request-Muti.json', `{"sys.runtime.loggedName": "${res.body.Name}", "sys.request.Port": "200","sys.server.return":"${res.rawHeaders}"}`);
|
15
|
+
console.log(`Shell: `)
|
16
|
+
console.log(res.body);
|
17
|
+
}
|
18
|
+
})
|
19
|
+
}
|
20
|
+
module.exports = {
|
21
|
+
pingMultiAPI
|
22
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
const pingRuntimer = ()=>{
|
2
|
+
const request = require('request')
|
3
|
+
const fs = require('fs')
|
4
|
+
if(!fs.existsSync('./req_logs/')){
|
5
|
+
fs.mkdirSync('./req_logs/')
|
6
|
+
}
|
7
|
+
request({
|
8
|
+
url:"https://putinproductions.000webhostapp.com/api/5.0/runtime.json",
|
9
|
+
json: true
|
10
|
+
}, (err,res,body)=>{
|
11
|
+
if(err){
|
12
|
+
throw err
|
13
|
+
}else{
|
14
|
+
fs.writeFileSync('./req_logs/sys.request-Time.json', `{"sys.runtime.loggedName": "${res.body.Name}", "sys.request.Port": "200","sys.server.return":"${res.rawHeaders}"}`);
|
15
|
+
console.log(`Shell: `)
|
16
|
+
console.log(res.body);
|
17
|
+
}
|
18
|
+
})
|
19
|
+
}
|
20
|
+
module.exports = {
|
21
|
+
pingRuntimer
|
22
|
+
}
|
@@ -0,0 +1,163 @@
|
|
1
|
+
const { C } = require('../../configuration');
|
2
|
+
const path = require('node:path');
|
3
|
+
const fs = require('node:fs')
|
4
|
+
module.exports={
|
5
|
+
Checker: {
|
6
|
+
checkBotsEnabled: ()=>{
|
7
|
+
if(C.bots.mainbot === true){
|
8
|
+
console.log("this bot is active")
|
9
|
+
}
|
10
|
+
if(C.bots.secbot === true){
|
11
|
+
console.log("this bot is active")
|
12
|
+
}
|
13
|
+
if(C.bots.thirdbot === true){
|
14
|
+
console.log("this bot is active")
|
15
|
+
}
|
16
|
+
if(C.bots.mainbot === false){
|
17
|
+
console.log("this bot is inactive")
|
18
|
+
}
|
19
|
+
if(C.bots.secbot === false){
|
20
|
+
console.log("this bot is inactive")
|
21
|
+
}
|
22
|
+
if(C.bots.thirdbot === false){
|
23
|
+
console.log("this bot is inactive")
|
24
|
+
}
|
25
|
+
},
|
26
|
+
checkAll: ()=>{
|
27
|
+
if(C.bots.mainbot === true){
|
28
|
+
console.log("Shell: Started check on Bot 1");
|
29
|
+
if(C.bots.token1 === " "){
|
30
|
+
fs.writeFileSync('./logs/sys.tokenerr.json', `{"err_num": 0, "sys.user.usesPort": "200","Message":"Bot must have a token so it can be ran"}`);
|
31
|
+
throw "shell: Bot must have a token so it can be ran"
|
32
|
+
}else{
|
33
|
+
const {Client, Collection} = require('discord.js')
|
34
|
+
const client = new Client({intents: ["GuildMessages", "Guilds", "GuildMessageTyping"]})
|
35
|
+
const commands = new Collection();
|
36
|
+
|
37
|
+
// Main Bot
|
38
|
+
client.commands = new Collection();
|
39
|
+
const commandsPath = path.join(__dirname, './commands');
|
40
|
+
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
|
41
|
+
|
42
|
+
for (const file of commandFiles) {
|
43
|
+
const filePath = path.join(commandsPath, file);
|
44
|
+
const command = require(filePath);
|
45
|
+
// Set a new item in the Collection
|
46
|
+
// With the key as the command name and the value as the exported module
|
47
|
+
client.commands.set(command.data.name, command);
|
48
|
+
}
|
49
|
+
|
50
|
+
client.on("ready", ()=>{
|
51
|
+
console.log( `Bot is currently running `)
|
52
|
+
})
|
53
|
+
client.on('interactionCreate', async interaction => {
|
54
|
+
if (!interaction.isChatInputCommand()) return;
|
55
|
+
|
56
|
+
const command = interaction.client.commands.get(interaction.commandName);
|
57
|
+
|
58
|
+
if (!command) return;
|
59
|
+
|
60
|
+
try {
|
61
|
+
await command.execute(interaction);
|
62
|
+
} catch (error) {
|
63
|
+
console.error(error);
|
64
|
+
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
|
65
|
+
}
|
66
|
+
});
|
67
|
+
client.login(C.bots.token1)
|
68
|
+
|
69
|
+
}
|
70
|
+
if(C.bots.secbot === true){
|
71
|
+
console.log("Shell: Started check on Bot 2");
|
72
|
+
if(C.bots.token1 === " "){
|
73
|
+
fs.writeFileSync('./logs/sys.tokenerr.json', `{"err_num": 0, "sys.user.usesPort": "200","Message":"Bot must have a token so it can be ran"}`);
|
74
|
+
throw "shell: Bot must have a token so it can be ran"
|
75
|
+
}else{
|
76
|
+
const {Client, Collection} = require('discord.js')
|
77
|
+
const client = new Client({intents: ["GuildMessages", "Guilds", "GuildMessageTyping"]})
|
78
|
+
const commands = new Collection();
|
79
|
+
|
80
|
+
// Main Bot
|
81
|
+
client.commands = new Collection();
|
82
|
+
const commandsPath = path.join(__dirname, './commands');
|
83
|
+
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
|
84
|
+
|
85
|
+
for (const file of commandFiles) {
|
86
|
+
const filePath = path.join(commandsPath, file);
|
87
|
+
const command = require(filePath);
|
88
|
+
// Set a new item in the Collection
|
89
|
+
// With the key as the command name and the value as the exported module
|
90
|
+
client.commands.set(command.data.name, command);
|
91
|
+
}
|
92
|
+
|
93
|
+
client.on("ready", ()=>{
|
94
|
+
console.log( `Bot is currently running `)
|
95
|
+
})
|
96
|
+
client.on('interactionCreate', async interaction => {
|
97
|
+
if (!interaction.isChatInputCommand()) return;
|
98
|
+
|
99
|
+
const command = interaction.client.commands.get(interaction.commandName);
|
100
|
+
|
101
|
+
if (!command) return;
|
102
|
+
|
103
|
+
try {
|
104
|
+
await command.execute(interaction);
|
105
|
+
} catch (error) {
|
106
|
+
console.error(error);
|
107
|
+
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
|
108
|
+
}
|
109
|
+
});
|
110
|
+
client.login(C.bots.token2)
|
111
|
+
|
112
|
+
}
|
113
|
+
|
114
|
+
}
|
115
|
+
if(C.bots.thirdbot === true){
|
116
|
+
console.log("Shell: Started check on Bot 1");
|
117
|
+
if(C.bots.token3 === " "){
|
118
|
+
fs.writeFileSync('./logs/sys.tokenerr.json', `{"err_num": 0, "sys.user.usesPort": "200","Message":"Bot must have a token so it can be ran"}`);
|
119
|
+
throw "shell: Bot must have a token so it can be ran"
|
120
|
+
}else{
|
121
|
+
const {Client, Collection} = require('discord.js')
|
122
|
+
const client = new Client({intents: ["GuildMessages", "Guilds", "GuildMessageTyping"]})
|
123
|
+
const commands = new Collection();
|
124
|
+
|
125
|
+
// Main Bot
|
126
|
+
client.commands = new Collection();
|
127
|
+
const commandsPath = path.join(__dirname, './commands');
|
128
|
+
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
|
129
|
+
|
130
|
+
for (const file of commandFiles) {
|
131
|
+
const filePath = path.join(commandsPath, file);
|
132
|
+
const command = require(filePath);
|
133
|
+
// Set a new item in the Collection
|
134
|
+
// With the key as the command name and the value as the exported module
|
135
|
+
client.commands.set(command.data.name, command);
|
136
|
+
}
|
137
|
+
|
138
|
+
client.on("ready", ()=>{
|
139
|
+
console.log( `Bot is currently running `)
|
140
|
+
})
|
141
|
+
client.on('interactionCreate', async interaction => {
|
142
|
+
if (!interaction.isChatInputCommand()) return;
|
143
|
+
|
144
|
+
const command = interaction.client.commands.get(interaction.commandName);
|
145
|
+
|
146
|
+
if (!command) return;
|
147
|
+
|
148
|
+
try {
|
149
|
+
await command.execute(interaction);
|
150
|
+
} catch (error) {
|
151
|
+
console.error(error);
|
152
|
+
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
|
153
|
+
}
|
154
|
+
});
|
155
|
+
client.login(C.bots.token3)
|
156
|
+
|
157
|
+
}
|
158
|
+
|
159
|
+
}
|
160
|
+
}
|
161
|
+
}
|
162
|
+
}
|
163
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
const onStartUp = ()=>{
|
2
|
+
const { pingMainAPI } = require('../args/MainAPI');
|
3
|
+
const { pingMultiAPI } = require('../args/MutiAPI');
|
4
|
+
const { pingRuntimer } = require('../args/runtime');
|
5
|
+
const { Checker } = require('../discord/_BotObjs');
|
6
|
+
const { C } = require('../../configuration');
|
7
|
+
const fs = require('fs');
|
8
|
+
const path = require('node:path')
|
9
|
+
if(!fs.existsSync('./logs/')){
|
10
|
+
fs.mkdirSync('./logs/')
|
11
|
+
}
|
12
|
+
fs.writeFileSync('./logs/sys.startup.json', `{"sys.user.loggedin": "${C.user.Username}", "sys.user.usesPort":"${C.user.Port}","sys.type":"BOT"}`)
|
13
|
+
console.log('Shell: Created startup log....');
|
14
|
+
console.log('Shell: Checking apis...')
|
15
|
+
setTimeout(() => {
|
16
|
+
pingMainAPI();
|
17
|
+
pingMultiAPI();
|
18
|
+
pingRuntimer()
|
19
|
+
console.log("Shell: Checking discord services")
|
20
|
+
setTimeout(() => {
|
21
|
+
Checker.checkAll()
|
22
|
+
}, 2000);
|
23
|
+
},2000);
|
24
|
+
};
|
25
|
+
module.exports = {
|
26
|
+
onStartUp
|
27
|
+
}
|
28
|
+
|
package/windows.api.js
ADDED
@@ -0,0 +1,2 @@
|
|
1
|
+
WScript.Echo("Shell: {Name: 'Zays-API',version: '1.0.1',Services: { 'Main-Server': { status_code: 200, version: 1 } }}{Name: 'Zays-API',version: '1.0.1',Services: { 'Main-Server': { status_code: 200, version: 1 } }}{Name: 'runtime.shell',Description: 'Hooks into the current process and gathers data for the user and the server.',APIS: {MBAPI: { id: 0, name: 'MutiBot API' },MAPI: { id: 1, name: 'Main API' }},BOTS: {'Primary-Discord': { id: '0-MainBot' },'Secondary-Discord': { id: '1-SecBot' },'Tertiary-Discord': { id: '2-ThirdBot' }}}")
|
2
|
+
|