-
Notifications
You must be signed in to change notification settings - Fork 1
/
initializer.js
68 lines (59 loc) · 1.91 KB
/
initializer.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
var fs = require('fs');
console.log("Initiating file generation process.");
if (!fs.existsSync('./config.json')) {
fs.writeFile(
'./config.json',
'{\n "developerMode":false,\n "prefix":"",\n "token":"",\n'+
' "deleteCommands":true,\n "deleteAfter":5000\n}',
function (log) {
console.log('+ "./config.json" was generated.');
}
);
}
if (!fs.existsSync('./disabled.json')) {
fs.writeFile(
'./disabled.json',
'{\n "commandTypes":[],\n "plugins":[]\n}',
function (log) {
console.log('+ "./disabled.json" was generated.');
}
);
}
if (!fs.existsSync('./permissions.json')) {
fs.writeFile(
'./permissions.json',
'{\n "say":{\n "channel-lock":[],\n "roles":[],\n'+
' "ids":[],\n "permissions":[]\n }\n}',
function (log) {
console.log('+ "./permissions.json" was generated.');
}
);
}
if (!fs.existsSync('./plugins/customcmds/customcmds.json')) {
fs.writeFile(
'./plugins/customcmds/customcmds.json',
'[\n {"command":"hello", "reply":true, "return":"hey there!"}\n]',
function (log) {
console.log('+ "./plugins/customcmds/customcmds.json" was generated.');
}
);
}
if (!fs.existsSync('./plugins/msgfilter/msgfilter.json')) {
fs.writeFile(
'./plugins/msgfilter/msgfilter.json',
'{\n "general":{\n "whitelist":[],\n "blacklist":[]\n }\n}',
function (log) {
console.log('+ "./plugins/msgfilter/msgfilter.json" was generated.');
}
);
}
if (!fs.existsSync('./plugins/welcome/welcome.json')) {
fs.writeFile(
'./plugins/welcome/welcome.json',
'{\n "message":"",\n "roles":[]\n}',
function (log) {
console.log('+ "./plugins/welcome/welcome.json" was generated.');
}
);
}
console.log("Process completed.");