queenamdi-functions-beta 0.0.27 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/amdiModule.js +1014 -1311
- package/base/qrDisplay.js +9 -79
- package/default.js +2 -1
- package/index.js +2 -1
- package/lib/amdiMenu.js +152 -0
- package/lib/settingsDB.js +86 -164
- package/package.json +1 -1
package/base/qrDisplay.js
CHANGED
@@ -1,81 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
_0x423be4 = _0x423be4 - 0x1c7;
|
5
|
-
let _0x1fcf20 = _0x3fe3cd[_0x423be4];
|
6
|
-
return _0x1fcf20;
|
7
|
-
}, _0x423b(_0x2c9e9a, _0x3ae3db);
|
8
|
-
}
|
9
|
-
function _0xbdf988(_0x108c7e, _0x12470d) {
|
10
|
-
return _0x423b(_0x12470d - -0xd7, _0x108c7e);
|
11
|
-
}
|
12
|
-
(function (_0x5d7113, _0x1887c9) {
|
13
|
-
const _0x43fc7e = _0x5d7113();
|
14
|
-
function _0x38e714(_0x19e83d, _0x38c9c9) {
|
15
|
-
return _0x423b(_0x19e83d - -0x33a, _0x38c9c9);
|
16
|
-
}
|
17
|
-
function _0x3bc88d(_0x1e5101, _0x2cd285) {
|
18
|
-
return _0x423b(_0x1e5101 - 0x256, _0x2cd285);
|
19
|
-
}
|
20
|
-
while (!![]) {
|
21
|
-
try {
|
22
|
-
const _0x93ac76 = -parseInt(_0x38e714(-0x166, -0x16a)) / 0x1 * (parseInt(_0x38e714(-0x167, -0x172)) / 0x2) + parseInt(_0x3bc88d(0x435, 0x43b)) / 0x3 + parseInt(_0x38e714(-0x168, -0x16b)) / 0x4 * (parseInt(_0x3bc88d(0x41e, 0x42a)) / 0x5) + parseInt(_0x38e714(-0x173, -0x16c)) / 0x6 * (-parseInt(_0x3bc88d(0x421, 0x425)) / 0x7) + -parseInt(_0x3bc88d(0x420, 0x41e)) / 0x8 * (parseInt(_0x3bc88d(0x423, 0x41f)) / 0x9) + parseInt(_0x38e714(-0x16e, -0x163)) / 0xa * (-parseInt(_0x38e714(-0x16b, -0x171)) / 0xb) + parseInt(_0x3bc88d(0x41f, 0x428)) / 0xc;
|
23
|
-
if (_0x93ac76 === _0x1887c9)
|
24
|
-
break;
|
25
|
-
else
|
26
|
-
_0x43fc7e['push'](_0x43fc7e['shift']());
|
27
|
-
} catch (_0x4b23f6) {
|
28
|
-
_0x43fc7e['push'](_0x43fc7e['shift']());
|
29
|
-
}
|
30
|
-
}
|
31
|
-
}(_0x3fe3, 0xc18ad));
|
32
|
-
function _0x3fe3() {
|
33
|
-
const _0x2a1d4e = [
|
34
|
-
'\x37\x38\x38\x34\x34\x31\x34\x70\x51\x79\x69\x67\x4e',
|
35
|
-
'\x64\x6f\x77\x6e\x6c\x6f\x61\x64\x42\x75',
|
36
|
-
'\x33\x35\x37\x39\x38\x34\x4a\x54\x51\x68\x4d\x41',
|
37
|
-
'\x61\x57\x4f\x74\x78\x53\x6d\x58\x71\x55',
|
38
|
-
'\x68\x74\x74\x70\x73\x3a\x2f\x2f\x6d\x65',
|
39
|
-
'\x31\x34\x32\x34\x52\x65\x41\x67\x65\x59',
|
40
|
-
'\x31\x38\x36\x68\x44\x52\x57\x5a\x6f',
|
41
|
-
'\x33\x35\x39\x37\x79\x68\x66\x47\x55\x4d',
|
42
|
-
'\x6d\x65\x67\x61\x6a\x73',
|
43
|
-
'\x62\x44\x46\x73\x69\x6d\x53\x70\x4d\x38',
|
44
|
-
'\x2e\x2f\x71\x72\x5f\x63\x6f\x64\x65\x2f',
|
45
|
-
'\x67\x6c\x31\x53\x36\x4b\x42\x6a\x5f\x32',
|
46
|
-
'\x71\x72\x5f\x67\x65\x6e',
|
47
|
-
'\x74\x6f\x53\x74\x72\x69\x6e\x67',
|
48
|
-
'\x66\x66\x65\x72',
|
49
|
-
'\x77\x72\x69\x74\x65\x46\x69\x6c\x65\x53',
|
50
|
-
'\x66\x72\x6f\x6d\x55\x52\x4c',
|
51
|
-
'\x79\x6e\x63',
|
52
|
-
'\x32\x31\x35\x36\x33\x38\x32\x44\x42\x47\x75\x65\x57',
|
53
|
-
'\x39\x74\x59\x56\x73\x66\x64\x32\x4e\x53',
|
54
|
-
'\x34\x32\x6b\x4f\x4c\x71\x52\x6f',
|
55
|
-
'\x35\x36\x32\x30\x55\x6d\x6b\x57\x63\x4f',
|
56
|
-
'\x33\x31\x39\x38\x33\x32\x37\x36\x54\x69\x5a\x47\x45\x6e',
|
57
|
-
'\x38\x6b\x70\x55\x48\x6d\x6d',
|
58
|
-
'\x32\x38\x33\x38\x37\x31\x41\x47\x6e\x68\x4a\x76',
|
59
|
-
'\x34\x36\x30\x7a\x4d\x41\x66\x6b\x47'
|
60
|
-
];
|
61
|
-
_0x3fe3 = function () {
|
62
|
-
return _0x2a1d4e;
|
63
|
-
};
|
64
|
-
return _0x3fe3();
|
65
|
-
}
|
66
|
-
var {File} = require(_0xbdf988(0xfb, 0xfe));
|
67
|
-
const fs = require('\x66\x73');
|
1
|
+
var { File } = require("megajs");
|
2
|
+
const fs = require('fs');
|
3
|
+
|
68
4
|
async function qrDisplayDL() {
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
return _0xbdf988(_0x31150b, _0x1ae2a6 - 0xe8);
|
74
|
-
}
|
75
|
-
const _0x2e5d53 = _0x2ebeb0(0x423, 0x41a) + '\x67\x61\x2e\x6e\x7a\x2f\x66\x69\x6c\x65' + '\x2f\x6f\x38\x42\x52\x43\x54\x71\x54\x23' + _0x2154b7(0x1e9, 0x1e9) + _0x2ebeb0(0x425, 0x41f) + _0x2154b7(0x1d8, 0x1e1) + _0x2ebeb0(0x42a, 0x429) + '\x44\x77\x67', _0x3b7482 = await File[_0x2ebeb0(0x42d, 0x426)](_0x2e5d53), _0x259e3d = await _0x3b7482[_0x2ebeb0(0x40c, 0x417) + _0x2154b7(0x1ec, 0x1ec)]();
|
76
|
-
fs[_0x2154b7(0x1f2, 0x1ed) + _0x2154b7(0x1e2, 0x1ef)](_0x2154b7(0x1e8, 0x1e8) + '\x71\x72\x2e\x68\x74\x6d\x6c', _0x259e3d[_0x2ebeb0(0x42a, 0x423)]());
|
77
|
-
}
|
78
|
-
function _0x3a09be(_0x236565, _0x2be453) {
|
79
|
-
return _0x423b(_0x236565 - 0x2e, _0x2be453);
|
5
|
+
const url = "https://mega.nz/file/o8BRCTqT#gl1S6KBj_2bDFsimSpM8aWOtxSmXqU9tYVsfd2NSDwg"
|
6
|
+
const file = await File.fromURL(url)
|
7
|
+
const data = await file.downloadBuffer()
|
8
|
+
fs.writeFileSync('./qr_code/qr.html', data.toString())
|
80
9
|
}
|
81
|
-
|
10
|
+
|
11
|
+
exports.qr_gen = qrDisplayDL
|
package/default.js
CHANGED
@@ -1,2 +1,3 @@
|
|
1
1
|
module.exports.aliveTXT0 = "```Hey There! Bot Online now. 💃🏻♥️```\n\n*Developer:* ```Black Amda```\n\n*Official Website:* https://amdaniwasa.com\n\n*Youtube channel :* https://www.youtube.com/channel/UCZx8U1EU95-Wn9mH4dn15vQ\n\n```Thank You For Using Queen Amdi💞```\n"
|
2
|
-
module.exports.alivePicURL0 = 'https://i.ibb.co/0nFvL1k/20220704-003142.jpg'
|
2
|
+
module.exports.alivePicURL0 = 'https://i.ibb.co/0nFvL1k/20220704-003142.jpg'
|
3
|
+
module.exports.amdiVoice = 'https://amdaniwasa.com/assets/QueenAmdiVoice.mp3'
|
package/index.js
CHANGED
@@ -23,4 +23,5 @@ exports.default = require("./default")
|
|
23
23
|
exports.amdiModule = require("./base/amdiModule")
|
24
24
|
exports.qrDisplay = require("./base/qrDisplay")
|
25
25
|
|
26
|
-
exports.settingsDB = require("./lib/settingsDB")
|
26
|
+
exports.settingsDB = require("./lib/settingsDB")
|
27
|
+
exports.sendCMD = require("./lib/amdiMenu")
|
package/lib/amdiMenu.js
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
const fs = require("fs")
|
2
|
+
const util = require("util");
|
3
|
+
const readdir = util.promisify(fs.readdir);
|
4
|
+
|
5
|
+
let PUB_CMD_HELP = '';
|
6
|
+
let PVT_CMD_HELP = '';
|
7
|
+
let ADM_CMD_HELP = '';
|
8
|
+
|
9
|
+
let PUB_CMD_HELP_01 = '';
|
10
|
+
let PUB_CMD_HELP_02 = '';
|
11
|
+
let PUB_CMD_HELP_03 = '';
|
12
|
+
let PUB_CMD_HELP_04 = '';
|
13
|
+
let PUB_CMD_HELP_05 = '';
|
14
|
+
|
15
|
+
let PVT_CMD_HELP_04 = '';
|
16
|
+
let PVT_CMD_HELP_05 = '';
|
17
|
+
|
18
|
+
let ADM_CMD_HELP_04 = '';
|
19
|
+
let ADM_CMD_HELP_05 = '';
|
20
|
+
|
21
|
+
const addCommands = async (Lang, prefix) => {
|
22
|
+
let path = "./plugins/primary/";
|
23
|
+
let filenames = await readdir(path);
|
24
|
+
filenames.forEach((file) => {
|
25
|
+
if (file.endsWith(".js")) {
|
26
|
+
let { command } = require("../../../plugins/primary/" + file);
|
27
|
+
let cmdMap = command();
|
28
|
+
const cmdInfo = cmdMap.cmdInfo;
|
29
|
+
for (let c of Object.keys(cmdInfo)) {
|
30
|
+
cmdObjects = cmdInfo[c];
|
31
|
+
if (cmdObjects.cmdHideInMenu == true || cmdObjects.cmd === undefined) return;
|
32
|
+
PUB_CMD_HELP += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
33
|
+
if (cmdObjects.desc) PUB_CMD_HELP += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
34
|
+
if (cmdObjects.example) PUB_CMD_HELP += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
35
|
+
|
36
|
+
if (cmdObjects.type == 'primary' || !cmdObjects.type) {
|
37
|
+
PUB_CMD_HELP_01 += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
38
|
+
if (cmdObjects.desc) PUB_CMD_HELP_01 += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
39
|
+
if (cmdObjects.example) PUB_CMD_HELP_01 += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
40
|
+
}
|
41
|
+
|
42
|
+
if (cmdObjects.type == 'download') {
|
43
|
+
PUB_CMD_HELP_02 += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
44
|
+
if (cmdObjects.desc) PUB_CMD_HELP_02 += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
45
|
+
if (cmdObjects.example) PUB_CMD_HELP_02 += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
46
|
+
}
|
47
|
+
|
48
|
+
if (cmdObjects.type == 'logo') {
|
49
|
+
PUB_CMD_HELP_03 += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
50
|
+
if (cmdObjects.desc) PUB_CMD_HELP_03 += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
51
|
+
if (cmdObjects.example) PUB_CMD_HELP_03 += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
52
|
+
}
|
53
|
+
|
54
|
+
if (cmdObjects.type == 'profile') {
|
55
|
+
PUB_CMD_HELP_04 += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
56
|
+
if (cmdObjects.desc) PUB_CMD_HELP_04 += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
57
|
+
if (cmdObjects.example) PUB_CMD_HELP_04 += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
58
|
+
}
|
59
|
+
|
60
|
+
if (cmdObjects.type == 'admin') {
|
61
|
+
PUB_CMD_HELP_05 += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
62
|
+
if (cmdObjects.desc) PUB_CMD_HELP_05 += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
63
|
+
if (cmdObjects.example) PUB_CMD_HELP_05 += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
});
|
68
|
+
|
69
|
+
path = "./plugins/private/";
|
70
|
+
filenames = await readdir(path);
|
71
|
+
filenames.forEach((file) => {
|
72
|
+
if (file.endsWith(".js")) {
|
73
|
+
let { command } = require("../../../plugins/private/" + file);
|
74
|
+
let cmdMap = command();
|
75
|
+
const cmdInfo = cmdMap.cmdInfo;
|
76
|
+
for (let c of Object.keys(cmdInfo)) {
|
77
|
+
cmdObjects = cmdInfo[c];
|
78
|
+
if (cmdObjects.cmdHideInMenu == true || cmdObjects.cmd === undefined) return;
|
79
|
+
PVT_CMD_HELP += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
80
|
+
if (cmdObjects.desc) PVT_CMD_HELP += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
81
|
+
if (cmdObjects.example) PVT_CMD_HELP += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
82
|
+
|
83
|
+
if (cmdObjects.type == 'profile') {
|
84
|
+
PVT_CMD_HELP_04 += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
85
|
+
if (cmdObjects.desc) PVT_CMD_HELP_04 += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
86
|
+
if (cmdObjects.example) PVT_CMD_HELP_04 += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
87
|
+
}
|
88
|
+
|
89
|
+
if (cmdObjects.type == 'admin') {
|
90
|
+
PVT_CMD_HELP_05 += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
91
|
+
if (cmdObjects.desc) PVT_CMD_HELP_05 += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
92
|
+
if (cmdObjects.example) PVT_CMD_HELP_05 += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
});
|
97
|
+
|
98
|
+
path = "./plugins/admin/";
|
99
|
+
filenames = await readdir(path);
|
100
|
+
filenames.forEach((file) => {
|
101
|
+
if (file.endsWith(".js")) {
|
102
|
+
let { command } = require("../../../plugins/admin/" + file);
|
103
|
+
let cmdMap = command();
|
104
|
+
const cmdInfo = cmdMap.cmdInfo;
|
105
|
+
for (let c of Object.keys(cmdInfo)) {
|
106
|
+
cmdObjects = cmdInfo[c];
|
107
|
+
if (cmdObjects.cmdHideInMenu == true || cmdObjects.cmd === undefined) return;
|
108
|
+
ADM_CMD_HELP += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
109
|
+
if (cmdObjects.desc) ADM_CMD_HELP += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
110
|
+
if (cmdObjects.example) ADM_CMD_HELP += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
111
|
+
|
112
|
+
if (cmdObjects.type == 'profile') {
|
113
|
+
ADM_CMD_HELP_04 += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
114
|
+
if (cmdObjects.desc) ADM_CMD_HELP_04 += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
115
|
+
if (cmdObjects.example) ADM_CMD_HELP_04 += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
116
|
+
}
|
117
|
+
|
118
|
+
if (cmdObjects.type == 'admin') {
|
119
|
+
ADM_CMD_HELP_05 += `⚙️ ${Lang.command}` + '```' + prefix + cmdObjects.cmd + (!cmdObjects.desc ? '```\n\n' : '```\n');
|
120
|
+
if (cmdObjects.desc) ADM_CMD_HELP_05 += `📃 ${Lang.desc}` + '```' + cmdObjects.desc + (!cmdObjects.example ? '```\n\n' : '```\n');
|
121
|
+
if (cmdObjects.example) ADM_CMD_HELP_05 += `🏷️ ${Lang.example}` + '```' + cmdObjects.example + '```\n\n';
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
});
|
126
|
+
}
|
127
|
+
|
128
|
+
module.exports.allcommands = async (Lang, isGroup, prefix, sendTemplate, sendButtonMsg) => {
|
129
|
+
addCommands(Lang, prefix)
|
130
|
+
|
131
|
+
const imageURL_BUTT = 'https://i.ibb.co/VWST1y1/1butt-All.jpg'
|
132
|
+
const imageURL_TEMP = 'https://i.ibb.co/2q9vH3D/1temp-All.jpg'
|
133
|
+
const text = `👥 ${Lang.primaryCMD}\n*﹊﹊﹊﹊﹊﹊﹊*\n` + PUB_CMD_HELP + '\n\n' +
|
134
|
+
`👤 ${Lang.pvtCMD}\n*﹊﹊﹊﹊﹊﹊﹊*\n` + PVT_CMD_HELP + '\n\n' +
|
135
|
+
`👑 ${Lang.adminCMD}\n*﹊﹊﹊﹊﹊﹊﹊*\n` + ADM_CMD_HELP
|
136
|
+
|
137
|
+
if (isGroup) {
|
138
|
+
const templateButtons = [
|
139
|
+
{index: 1, urlButton: {displayText: '💃🏻 Official Website', url: 'https://amdaniwasa.com/'}},
|
140
|
+
{index: 2, urlButton: {displayText: '🎞️ AN Tech YouTube Channel', url: 'https://www.youtube.com/channel/UCZx8U1EU95-Wn9mH4dn15vQ'}},
|
141
|
+
{index: 3, quickReplyButton: {displayText: Lang.rateUs, id: `${prefix}qaratebot`}},
|
142
|
+
{index: 4, quickReplyButton: {displayText: Lang.sysStats, id: `${prefix}qasysstats`}}
|
143
|
+
]
|
144
|
+
await sendTemplate(templateButtons, text, tagMsg = true, imageURL_TEMP)
|
145
|
+
} else {
|
146
|
+
const buttons = [
|
147
|
+
{buttonId: `${prefix}qaratebot`, buttonText: {displayText: Lang.rateUs}, type: 1},
|
148
|
+
{buttonId: `${prefix}qasysstats`, buttonText: {displayText: Lang.sysStats}, type: 1}
|
149
|
+
]
|
150
|
+
await sendButtonMsg(buttons, text, tagMsg = true, imageURL_BUTT)
|
151
|
+
}
|
152
|
+
}
|
package/lib/settingsDB.js
CHANGED
@@ -21,178 +21,100 @@
|
|
21
21
|
Licensed under the GPL-3.0 License;
|
22
22
|
you may not use this file except in compliance with the License.*/
|
23
23
|
|
24
|
-
/**@settingtype CHAT_UPDATES,
|
24
|
+
/**@settingtype CHAT_UPDATES, READ_CMD, REMOVE_BG_API, ALIVEPIC, ALIVETXT*/
|
25
25
|
|
26
|
-
(
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
const {Pool} = require('\x70\x67'), _0x11c5fe = {};
|
47
|
-
_0x11c5fe[_0x571c39(0x2aa, 0x29c) + _0x4adb12(0x3be, 0x3be)] = ![];
|
48
|
-
const _0x483d02 = {};
|
49
|
-
_0x483d02[_0x571c39(0x29e, 0x29b) + _0x4adb12(0x38c, 0x38e)] = process[_0x4adb12(0x387, 0x39e)][_0x571c39(0x2ba, 0x2ae) + '\x52\x4c'], _0x483d02[_0x4adb12(0x3b1, 0x3b0)] = _0x11c5fe;
|
50
|
-
function _0x5cd0(_0xae741d, _0x313a51) {
|
51
|
-
const _0x51ac70 = _0x51ac();
|
52
|
-
return _0x5cd0 = function (_0x5cd08f, _0x350939) {
|
53
|
-
_0x5cd08f = _0x5cd08f - 0x95;
|
54
|
-
let _0x2779c0 = _0x51ac70[_0x5cd08f];
|
55
|
-
return _0x2779c0;
|
56
|
-
}, _0x5cd0(_0xae741d, _0x313a51);
|
57
|
-
}
|
58
|
-
function _0x571c39(_0x4c5101, _0x49d531) {
|
59
|
-
return _0x5cd0(_0x49d531 - 0x1ea, _0x4c5101);
|
60
|
-
}
|
61
|
-
const proConfig = _0x483d02, pool = new Pool(proConfig), createSettingsTable = async () => {
|
62
|
-
function _0x146b90(_0x216337, _0x19990a) {
|
63
|
-
return _0x4adb12(_0x19990a, _0x216337 - -0xda);
|
64
|
-
}
|
65
|
-
function _0x238549(_0x286e0f, _0x55271f) {
|
66
|
-
return _0x571c39(_0x286e0f, _0x55271f - -0x3c8);
|
67
|
-
}
|
68
|
-
await pool[_0x146b90(0x2c1, 0x2cc)]('\x43\x52\x45\x41\x54\x45\x20\x54\x41\x42' + '\x4c\x45\x20\x49\x46\x20\x4e\x4f\x54\x20' + _0x146b90(0x2e7, 0x2e3) + _0x146b90(0x2e6, 0x2da) + _0x238549(-0x13d, -0x136) + _0x146b90(0x2ce, 0x2d2) + _0x146b90(0x2e5, 0x2dd) + '\x29\x3b');
|
69
|
-
};
|
70
|
-
module[_0x4adb12(0x3b6, 0x3bb)][_0x4adb12(0x383, 0x38b) + _0x571c39(0x2a3, 0x299)] = async (_0x582b9a, _0x41a84f) => {
|
71
|
-
function _0x3af1f9(_0x473e93, _0x19e624) {
|
72
|
-
return _0x571c39(_0x473e93, _0x19e624 - -0x397);
|
73
|
-
}
|
26
|
+
require('dotenv').config()
|
27
|
+
const { Pool } = require("pg");
|
28
|
+
|
29
|
+
const proConfig = {
|
30
|
+
connectionString: process.env.DATABASE_URL,
|
31
|
+
ssl: {
|
32
|
+
rejectUnauthorized: false,
|
33
|
+
},
|
34
|
+
};
|
35
|
+
|
36
|
+
const pool = new Pool(proConfig);
|
37
|
+
|
38
|
+
const createSettingsTable = async () => {
|
39
|
+
await pool.query(
|
40
|
+
"CREATE TABLE IF NOT EXISTS settingsTable(settingtype text , input text);"
|
41
|
+
);
|
42
|
+
};
|
43
|
+
|
44
|
+
// Settings DB
|
45
|
+
module.exports.inputSettings = async (settingtype, input) => {
|
74
46
|
await createSettingsTable();
|
75
|
-
|
76
|
-
|
77
|
-
|
47
|
+
|
48
|
+
let result = await pool.query(
|
49
|
+
"select * from settingsTable WHERE settingtype=$1;",
|
50
|
+
[settingtype]
|
51
|
+
);
|
52
|
+
|
53
|
+
if (result.rows.length) {
|
54
|
+
let count = result.rows[0].count;
|
55
|
+
await pool.query(
|
56
|
+
"UPDATE settingsTable SET input = $1 WHERE settingtype=$2;",
|
57
|
+
[input, settingtype]
|
58
|
+
);
|
59
|
+
await pool.query("commit;");
|
60
|
+
return count;
|
61
|
+
} else {
|
62
|
+
await pool.query("INSERT INTO settingsTable VALUES($1,$2);", [
|
63
|
+
settingtype,
|
64
|
+
input,
|
65
|
+
]);
|
66
|
+
await pool.query("commit;");
|
67
|
+
return 1;
|
78
68
|
}
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
_0x41a84f,
|
83
|
-
_0x582b9a
|
84
|
-
]), await pool['\x71\x75\x65\x72\x79'](_0x3af1f9(-0xf6, -0xe7)), _0x53e2b7;
|
85
|
-
} else
|
86
|
-
return await pool[_0x4ad615(-0x144, -0x158)](_0x3af1f9(-0x105, -0x100) + '\x4f\x20\x73\x65\x74\x74\x69\x6e\x67\x73' + _0x3af1f9(-0xef, -0x104) + _0x4ad615(-0x14d, -0x15f), [
|
87
|
-
_0x582b9a,
|
88
|
-
_0x41a84f
|
89
|
-
]), await pool[_0x4ad615(-0x144, -0x148)]('\x63\x6f\x6d\x6d\x69\x74\x3b'), 0x1;
|
90
|
-
}, module[_0x4adb12(0x3cd, 0x3bb)][_0x4adb12(0x3c0, 0x3a9) + '\x73'] = async _0x2d461d => {
|
69
|
+
};
|
70
|
+
|
71
|
+
module.exports.getSettings = async (settingtype) => {
|
91
72
|
await createSettingsTable();
|
92
|
-
|
93
|
-
|
73
|
+
let result = await pool.query(
|
74
|
+
"SELECT input FROM settingsTable WHERE settingtype=$1;",
|
75
|
+
[settingtype]
|
76
|
+
);
|
77
|
+
if (result.rowCount) {
|
78
|
+
return result.rows[0];
|
79
|
+
} else {
|
80
|
+
return -1;
|
94
81
|
}
|
95
|
-
let _0x4b4a10 = await pool['\x71\x75\x65\x72\x79'](_0x5c1540(0x2ef, 0x30c) + _0x5c1540(0x2ee, 0x2e2) + _0x5c1540(0x317, 0x308) + _0x282f21(0x1a4, 0x188) + _0x5c1540(0x31a, 0x321) + '\x24\x31\x3b', [_0x2d461d]);
|
96
|
-
function _0x5c1540(_0x4561a3, _0x1272ef) {
|
97
|
-
return _0x571c39(_0x1272ef, _0x4561a3 - 0x6f);
|
98
|
-
}
|
99
|
-
return _0x4b4a10[_0x5c1540(0x322, 0x30d)] ? _0x4b4a10['\x72\x6f\x77\x73'][0x0] : -0x1;
|
100
82
|
};
|
101
|
-
|
102
|
-
|
103
|
-
}
|
104
|
-
function _0x51ac() {
|
105
|
-
const _0x4c2a7b = [
|
106
|
-
'\x32\x34\x33\x5a\x4e\x77\x51\x43\x47',
|
107
|
-
'\x53\x74\x72\x69\x6e\x67',
|
108
|
-
'\x63\x6f\x75\x6e\x74',
|
109
|
-
'\x67\x74\x79\x70\x65\x3d\x24\x31\x3b',
|
110
|
-
'\x6c\x65\x6e\x67\x74\x68',
|
111
|
-
'\x45\x53\x28\x24\x31\x2c\x24\x32\x29\x3b',
|
112
|
-
'\x62\x6c\x65\x3b',
|
113
|
-
'\x73\x65\x74\x74\x69\x6e\x67\x73\x54\x61',
|
114
|
-
'\x4f\x20\x73\x65\x74\x74\x69\x6e\x67\x73',
|
115
|
-
'\x38\x31\x34\x33\x30\x39\x36\x69\x6c\x4c\x4a\x54\x66',
|
116
|
-
'\x72\x6f\x77\x73',
|
117
|
-
'\x69\x6e\x67\x73',
|
118
|
-
'\x65\x74\x74\x69\x6e\x67\x74\x79\x70\x65',
|
119
|
-
'\x72\x65\x6d\x6f\x76\x65\x53\x65\x74\x74',
|
120
|
-
'\x71\x75\x65\x72\x79',
|
121
|
-
'\x28\x73\x65\x74\x74\x69\x6e\x67\x74\x79',
|
122
|
-
'\x54\x61\x62\x6c\x65\x20\x56\x41\x4c\x55',
|
123
|
-
'\x65\x6e\x76',
|
124
|
-
'\x33\x30\x32\x31\x31\x30\x76\x6e\x67\x53\x7a\x43',
|
125
|
-
'\x55\x50\x44\x41\x54\x45\x20\x73\x65\x74',
|
126
|
-
'\x49\x4e\x53\x45\x52\x54\x20\x49\x4e\x54',
|
127
|
-
'\x31\x36\x35\x38\x36\x36\x32\x4d\x68\x54\x64\x66\x5a',
|
128
|
-
'\x6e\x67\x73',
|
129
|
-
'\x37\x57\x4e\x70\x76\x68\x48',
|
130
|
-
'\x63\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e',
|
131
|
-
'\x72\x65\x6a\x65\x63\x74\x55\x6e\x61\x75',
|
132
|
-
'\x37\x39\x31\x39\x38\x34\x30\x59\x47\x71\x54\x61\x5a',
|
133
|
-
'\x70\x65\x20\x74\x65\x78\x74\x20\x2c\x20',
|
134
|
-
'\x67\x65\x74\x53\x65\x74\x74\x69\x6e\x67',
|
135
|
-
'\x38\x36\x32\x37\x33\x34\x5a\x4e\x51\x58\x78\x75',
|
136
|
-
'\x45\x52\x45\x20\x73\x65\x74\x74\x69\x6e',
|
137
|
-
'\x65\x20\x57\x48\x45\x52\x45\x20\x73\x65',
|
138
|
-
'\x31\x32\x30\x36\x30\x35\x31\x30\x79\x63\x75\x74\x63\x78',
|
139
|
-
'\x45\x20\x73\x65\x74\x74\x69\x6e\x67\x74',
|
140
|
-
'\x63\x6f\x6e\x66\x69\x67',
|
141
|
-
'\x73\x73\x6c',
|
142
|
-
'\x20\x3d\x20\x27\x64\x65\x66\x61\x75\x6c',
|
143
|
-
'\x74\x74\x69\x6e\x67\x73\x54\x61\x62\x6c',
|
144
|
-
'\x33\x34\x35\x31\x34\x38\x59\x77\x6f\x41\x65\x4b',
|
145
|
-
'\x20\x53\x45\x54\x20\x69\x6e\x70\x75\x74',
|
146
|
-
'\x74\x74\x69\x6e\x67\x74\x79\x70\x65\x3d',
|
147
|
-
'\x31\x5a\x53\x54\x47\x64\x76',
|
148
|
-
'\x72\x6f\x6d\x20\x73\x65\x74\x74\x69\x6e',
|
149
|
-
'\x44\x41\x54\x41\x42\x41\x53\x45\x5f\x55',
|
150
|
-
'\x74\x27\x20\x57\x48\x45\x52\x45\x20\x73',
|
151
|
-
'\x63\x6f\x6d\x6d\x69\x74\x3b',
|
152
|
-
'\x65\x78\x70\x6f\x72\x74\x73',
|
153
|
-
'\x32\x31\x73\x52\x51\x76\x57\x70',
|
154
|
-
'\x72\x6f\x77\x43\x6f\x75\x6e\x74',
|
155
|
-
'\x74\x68\x6f\x72\x69\x7a\x65\x64',
|
156
|
-
'\x69\x6e\x70\x75\x74\x20\x74\x65\x78\x74',
|
157
|
-
'\x74\x69\x6e\x67\x73\x54\x61\x62\x6c\x65',
|
158
|
-
'\x45\x58\x49\x53\x54\x53\x20\x73\x65\x74',
|
159
|
-
'\x79\x70\x65\x3d\x24\x32\x3b',
|
160
|
-
'\x20\x3d\x20\x24\x31\x20\x57\x48\x45\x52',
|
161
|
-
'\x75\x74\x20\x46\x52\x4f\x4d\x20\x73\x65',
|
162
|
-
'\x53\x45\x4c\x45\x43\x54\x20\x69\x6e\x70',
|
163
|
-
'\x69\x6e\x70\x75\x74\x53\x65\x74\x74\x69',
|
164
|
-
'\x67\x73\x54\x61\x62\x6c\x65\x20\x57\x48'
|
165
|
-
];
|
166
|
-
_0x51ac = function () {
|
167
|
-
return _0x4c2a7b;
|
168
|
-
};
|
169
|
-
return _0x51ac();
|
170
|
-
}
|
171
|
-
module[_0x4adb12(0x3b9, 0x3bb)][_0x4adb12(0x399, 0x3a9) + '\x73\x4c\x69\x73\x74'] = async () => {
|
172
|
-
function _0x3d2b3e(_0x422149, _0x22ad09) {
|
173
|
-
return _0x571c39(_0x422149, _0x22ad09 - -0xa2);
|
174
|
-
}
|
83
|
+
|
84
|
+
module.exports.getSettingsList = async () => {
|
175
85
|
await createSettingsTable();
|
176
|
-
|
177
|
-
|
86
|
+
let result = await pool.query(
|
87
|
+
"SELECT input,settingtype FROM settingsTable;"
|
88
|
+
);
|
89
|
+
if (result.rowCount) {
|
90
|
+
return result.rows;
|
91
|
+
} else {
|
92
|
+
return [];
|
178
93
|
}
|
179
|
-
|
180
|
-
|
181
|
-
|
94
|
+
};
|
95
|
+
|
96
|
+
module.exports.removeSettings = async (settingtype) => {
|
182
97
|
await createSettingsTable();
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
98
|
+
|
99
|
+
let result = await pool.query(
|
100
|
+
"select * from settingsTable WHERE settingtype=$1;",
|
101
|
+
[settingtype]
|
102
|
+
);
|
103
|
+
|
104
|
+
if (result.rows.length) {
|
105
|
+
let count = result.rows[0].count;
|
106
|
+
await pool.query(
|
107
|
+
"UPDATE settingsTable SET input = 'default' WHERE settingtype=$1;",
|
108
|
+
[settingtype]
|
109
|
+
);
|
110
|
+
await pool.query("commit;");
|
111
|
+
return count;
|
112
|
+
} else {
|
113
|
+
await pool.query("INSERT INTO settingsTable VALUES($1,$2);", [
|
114
|
+
settingtype,
|
115
|
+
'default',
|
116
|
+
]);
|
117
|
+
await pool.query("commit;");
|
118
|
+
return 1;
|
189
119
|
}
|
190
|
-
if (_0x1017f8['\x72\x6f\x77\x73']['\x6c\x65\x6e\x67\x74\x68']) {
|
191
|
-
let _0x1dc421 = _0x1017f8[_0x4638be(-0x1ac, -0x1bf)][0x0][_0x4638be(-0x1bf, -0x1c7)];
|
192
|
-
return await pool[_0x27e1dc(-0x1c8, -0x1de)]('\x55\x50\x44\x41\x54\x45\x20\x73\x65\x74' + _0x4638be(-0x193, -0x196) + _0x27e1dc(-0x1b5, -0x1c5) + _0x4638be(-0x199, -0x1a5) + _0x27e1dc(-0x1be, -0x1c0) + _0x27e1dc(-0x1e1, -0x1e0) + '\x3d\x24\x31\x3b', [_0x219704]), await pool[_0x4638be(-0x1a0, -0x1bb)](_0x27e1dc(-0x1a4, -0x1bf)), _0x1dc421;
|
193
|
-
} else
|
194
|
-
return await pool[_0x4638be(-0x1c8, -0x1bb)](_0x27e1dc(-0x1c2, -0x1d8) + _0x27e1dc(-0x1e9, -0x1e4) + _0x4638be(-0x1d0, -0x1b9) + _0x27e1dc(-0x1cf, -0x1e7), [
|
195
|
-
_0x219704,
|
196
|
-
'\x64\x65\x66\x61\x75\x6c\x74'
|
197
|
-
]), await pool[_0x4638be(-0x1d8, -0x1bb)](_0x4638be(-0x19c, -0x19c)), 0x1;
|
198
120
|
};
|