the end is near (Pergboard Nerd)
This commit is contained in:
parent
5bc26fb28a
commit
b5362110c4
1 changed files with 17 additions and 15 deletions
32
index.js
32
index.js
|
@ -4,24 +4,11 @@ const path = require('path')
|
|||
var LdapAuth = require('ldapauth-fork');
|
||||
|
||||
var prankPath = "prankdata.txt";
|
||||
if (!fs.existsSync(prankPath)) {
|
||||
fs.writeFileSync(prankPath, "{}");
|
||||
}
|
||||
|
||||
var activityPath = "activitydata.txt";
|
||||
if (!fs.existsSync(activityPath)) {
|
||||
fs.writeFileSync(activityPath, "{}");
|
||||
}
|
||||
|
||||
var treasurePath = "treasuredata.txt";
|
||||
if (!fs.existsSync(treasurePath)) {
|
||||
fs.writeFileSync(treasurePath, "{}");
|
||||
}
|
||||
|
||||
var goldenUsersPath = "goldenusers.txt";
|
||||
if (!fs.existsSync(goldenUsersPath)) {
|
||||
fs.writeFileSync(goldenUsersPath, "{}");
|
||||
}
|
||||
|
||||
initFs();
|
||||
|
||||
let PrankData = JSON.parse(fs.readFileSync(prankPath));
|
||||
let ActivityData = JSON.parse(fs.readFileSync(activityPath));
|
||||
|
@ -671,6 +658,21 @@ function checkManage(content, input, data) {
|
|||
}
|
||||
}
|
||||
|
||||
function initFs() {
|
||||
if (!fs.existsSync(prankPath)) {
|
||||
fs.writeFileSync(prankPath, "{}");
|
||||
}
|
||||
if (!fs.existsSync(activityPath)) {
|
||||
fs.writeFileSync(activityPath, "{}");
|
||||
}
|
||||
if (!fs.existsSync(treasurePath)) {
|
||||
fs.writeFileSync(treasurePath, "{}");
|
||||
}
|
||||
if (!fs.existsSync(goldenUsersPath)) {
|
||||
fs.writeFileSync(goldenUsersPath, "{}");
|
||||
}
|
||||
}
|
||||
|
||||
function makeid(length) {
|
||||
var result = '';
|
||||
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
|
|
Loading…
Reference in a new issue