cuffeo/src/inc/admin.mjs
2018-09-08 12:43:55 +02:00

25 lines
573 B
JavaScript

let _admins = [];
export default {
admins: _admins,
getLevel: (network, user) => {
let ret = {
level: 0,
verified: false
};
if (typeof user !== "object")
return "user has to be an object!";
if (!user.account || !user.prefix)
return ret;
for(let admin of _admins) {
if (admin.account === user.account.toLowerCase() && admin.network === network.toLowerCase()) {
ret = {
level: admin.level,
verified: user.prefix.toLowerCase() === admin.prefix
};
}
};
return ret;
}
};