-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
77 lines (67 loc) · 1.88 KB
/
config.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
require('dotenv').config();
const fs = require("fs")
const chalk = require("chalk")
global.reloadFile = (file, options = {}) => {
nocache(file, module => console.log(`File "${file}" has updated`))
}
// Rest Api
global.APIs = {
zenz: 'https://zenzapis.xyz',
}
// Apikey
global.APIKeys = {
'https://zenzapis.xyz': process.env.ZENZAPIS_KEY,
}
console.log(APIKeys);
// Other
global.options = {
autoRead: true,
self: true,
mute: false
}
global.prefa = /^[zZ#$+.?_&<>!/\\]/
global.owner = process.env.OWNER_NUMBER.split(',')
global.sessionName = {
legacy: "/tmp/zkyera-legacy",
multi: "/tmp/zkyera-multi"
}
global.packname = "zkyera"
global.author = "ZKY ERA"
global.mess = (type, m) => {
let msg = {
wait: 'Wait, in progress',
owner: 'Perintah ini hanya dapat digunakan oleh Owner!',
group: 'Perintah ini hanya dapat digunakan di group!',
private: 'Perintah ini hanya dapat digunakan di private chat!',
admin: 'Perintah ini hanya dapat digunakan oleh admin group!',
botAdmin: 'Bot bukan admin, tidak dapat mengakses fitur tersebut',
bot: 'Fitur ini hanya dapat diakses oleh Bot',
dead: 'Fitur ini sedang dimatikan!',
media: 'Reply media',
error: "No Results Found"
} [type]
if (msg) return m.reply(msg, m.from, {
quoted: m
})
}
function nocache(module, cb = () => {}) {
fs.watchFile(require.resolve(module), async () => {
await uncache(require.resolve(module))
cb(module)
})
}
function uncache(module = '.') {
return new Promise((resolve, reject) => {
try {
delete require.cache[require.resolve(module)]
resolve()
} catch (e) {
reject(e)
}
})
}
let file = require.resolve(__filename)
fs.watchFile(file, () => {
fs.unwatchFile(file)
console.log(chalk.redBright(`Update File "${file}"`))
})