-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.js
33 lines (30 loc) · 986 Bytes
/
update.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
import { createRequire } from "module"
const require = createRequire(import.meta.url)
const servers = require("./servers.json")
const fs = require("fs")
for (let i = 0; i < servers.length; i++) {
const server = servers[i];
server["users"] = []
if (!server.logChannelID) server["logChannelID"] = ""
for (let j = 0; j < server.agencies.length; j++) {
const agency = server.agencies[j];
server.users.push({
id: agency.userId,
money: agency.money / 10,
agency: {
name: agency.name,
description: agency.description,
research: agency.research,
level: agency.level
}
})
}
delete server["agencies"]
delete server["blueprints"]
delete server["research"]
delete server["levels"]
delete server["banks"]
}
fs.writeFile("./servers.json", JSON.stringify(servers), function (error) {
if (error) console.log(error);
})