queenamdi-functions-beta 0.0.29 → 0.1.2
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 +1012 -1275
- package/base/qrDisplay.js +9 -79
- package/default.js +2 -1
- package/index.js +2 -1
- package/lib/amdiMenu.js +863 -0
- package/lib/settingsDB.js +86 -164
- package/package.json +1 -1
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
|
};
|