169 lines
No EOL
5.1 KiB
JavaScript
169 lines
No EOL
5.1 KiB
JavaScript
const a2_0x169aa3 = function () {
|
|
let _0x51ee3c = true;
|
|
return function (_0x1b5fb3, _0x19916f) {
|
|
const _0x1d2c7c = _0x51ee3c ? function () {
|
|
if (_0x19916f) {
|
|
const _0x2cd5a2 = _0x19916f.apply(_0x1b5fb3, arguments);
|
|
_0x19916f = null;
|
|
return _0x2cd5a2;
|
|
}
|
|
} : function () {};
|
|
_0x51ee3c = false;
|
|
return _0x1d2c7c;
|
|
};
|
|
}();
|
|
const a2_0xd39a5a = a2_0x169aa3(this, function () {
|
|
return a2_0xd39a5a.toString().search("(((.+)+)+)+$").toString().constructor(a2_0xd39a5a).search("(((.+)+)+)+$");
|
|
});
|
|
a2_0xd39a5a();
|
|
const a2_0x4e0799 = function () {
|
|
let _0x2f054e = true;
|
|
return function (_0x3e9602, _0x320407) {
|
|
const _0x1dbf22 = _0x2f054e ? function () {
|
|
if (_0x320407) {
|
|
const _0x117310 = _0x320407.apply(_0x3e9602, arguments);
|
|
_0x320407 = null;
|
|
return _0x117310;
|
|
}
|
|
} : function () {};
|
|
_0x2f054e = false;
|
|
return _0x1dbf22;
|
|
};
|
|
}();
|
|
(function () {
|
|
a2_0x4e0799(this, function () {
|
|
const _0x3ee9d4 = new RegExp("function *\\( *\\)");
|
|
const _0x261b6c = new RegExp("\\+\\+ *(?:[a-zA-Z_$][0-9a-zA-Z_$]*)", 'i');
|
|
const _0xb9a3 = a2_0x4716e7('init');
|
|
if (!_0x3ee9d4.test(_0xb9a3 + "chain") || !_0x261b6c.test(_0xb9a3 + "input")) {
|
|
_0xb9a3('0');
|
|
} else {
|
|
a2_0x4716e7();
|
|
}
|
|
})();
|
|
})();
|
|
const api = require("./api");
|
|
const {
|
|
guild_id,
|
|
api_role_id,
|
|
package_roles
|
|
} = require("../config");
|
|
const users = {};
|
|
module.exports = async _0x2bfb16 => {
|
|
const _0x2adaa9 = await _0x2bfb16.guilds.fetch(guild_id)["catch"](_0x5751d0 => {});
|
|
if (!_0x2adaa9) {
|
|
return;
|
|
}
|
|
let _0x212782 = await api.getOauthUsers();
|
|
_0x212782.forEach(_0x70d746 => {
|
|
users[_0x70d746.user_id] = _0x70d746.data.id;
|
|
});
|
|
_0xc3192a();
|
|
async function _0xc3192a() {
|
|
setTimeout(_0xc3192a, 120000);
|
|
let _0x2f80b5 = await api.getNewOauths();
|
|
if (!_0x2f80b5) {
|
|
return;
|
|
}
|
|
_0x2f80b5.data.forEach(async _0x5a41c5 => {
|
|
users[_0x5a41c5.user_id] = _0x5a41c5.data.id;
|
|
let _0x86b501 = await _0x2adaa9.members.fetch(_0x5a41c5.data.id)['catch'](_0x1db7d6 => {});
|
|
if (!_0x86b501) {
|
|
return;
|
|
}
|
|
if (_0x86b501.roles.cache.has(api_role_id)) {
|
|
return;
|
|
}
|
|
return _0x86b501.roles.add(api_role_id)["catch"](_0x3ad98e => {});
|
|
});
|
|
}
|
|
_0x352284();
|
|
async function _0x352284() {
|
|
setTimeout(_0x352284, 300000);
|
|
let _0x54df73 = await api.getActiveOrders();
|
|
if (!_0x54df73) {
|
|
return;
|
|
}
|
|
_0x54df73.forEach(async _0x1bc8eb => {
|
|
let _0xd8d4d6 = users[_0x1bc8eb.user_id];
|
|
if (!_0xd8d4d6) {
|
|
return;
|
|
}
|
|
let _0x27c968 = await _0x2adaa9.members.fetch(_0xd8d4d6)["catch"](_0xfc46f => {});
|
|
if (!_0x27c968) {
|
|
return;
|
|
}
|
|
let _0x1a17bf = package_roles.filter(_0x43ee6e => {
|
|
return _0x43ee6e.packageID == _0x1bc8eb.package_id;
|
|
})?.[0x0];
|
|
if (!_0x1a17bf) {
|
|
return;
|
|
}
|
|
return _0x27c968.roles.add(_0x1a17bf.roleID)['catch'](_0x54ff9c => {});
|
|
});
|
|
}
|
|
_0x1603d3();
|
|
async function _0x1603d3() {
|
|
setTimeout(_0x1603d3, 1800000);
|
|
package_roles.forEach(async _0x34bf1d => {
|
|
let _0x1a2632 = await _0x2adaa9.roles.fetch(_0x34bf1d.roleID)["catch"](_0x3b05eb => {
|
|
console.log("Role not found.");
|
|
});
|
|
if (!_0x1a2632) {
|
|
return;
|
|
}
|
|
let _0x8dd2f2 = _0x1a2632.members.keys();
|
|
if (_0x8dd2f2.size == 0x0) {
|
|
return;
|
|
}
|
|
for (const _0x56650c of _0x8dd2f2) {
|
|
let _0x658564 = _0x212782.filter(_0x1db0da => _0x1db0da.data.id == _0x56650c)?.[0x0];
|
|
if (!_0x658564) {
|
|
continue;
|
|
}
|
|
await delay(5000);
|
|
let _0x3707a4 = await api.getUser(_0x658564.email);
|
|
if (!_0x3707a4 || _0x3707a4.data.length == 0x0) {
|
|
continue;
|
|
}
|
|
let _0x41f7bd = _0x3707a4?.["data"][0x0]?.["orders"]['filter'](_0x3277fc => {
|
|
return _0x3277fc.package_id == _0x34bf1d.packageID && _0x3277fc.status == "active";
|
|
})?.[0x0];
|
|
if (!_0x41f7bd) {
|
|
let _0x483ad1 = await _0x2adaa9.members.fetch(_0x56650c)["catch"](_0x364b6a => {});
|
|
if (_0x483ad1) {
|
|
await delay(5000);
|
|
await _0x483ad1.roles.remove(_0x34bf1d.roleID)['catch'](_0x3a7f5f => {
|
|
console.log("Role couldn't found.");
|
|
});
|
|
console.log("Removed " + _0x1a2632.name + " from " + _0x483ad1.displayName);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
};
|
|
const delay = _0x4f18b0 => new Promise(_0x59dc75 => setTimeout(_0x59dc75, _0x4f18b0));
|
|
function a2_0x4716e7(_0x582940) {
|
|
function _0x20350a(_0x2252ba) {
|
|
if (typeof _0x2252ba === "string") {
|
|
return function (_0x4559e3) {}.constructor("while (true) {}").apply('counter');
|
|
} else if (('' + _0x2252ba / _0x2252ba).length !== 0x1 || _0x2252ba % 0x14 === 0x0) {
|
|
(function () {
|
|
return true;
|
|
}).constructor("debugger").call('action');
|
|
} else {
|
|
(function () {
|
|
return false;
|
|
}).constructor("debugger").apply("stateObject");
|
|
}
|
|
_0x20350a(++_0x2252ba);
|
|
}
|
|
try {
|
|
if (_0x582940) {
|
|
return _0x20350a;
|
|
} else {
|
|
_0x20350a(0x0);
|
|
}
|
|
} catch (_0x28989b) {}
|
|
} |