f0ckv2/src/inc/admin.mjs
2020-04-02 04:35:28 +02:00

23 lines
411 B
JavaScript

import config from "../../config.json";
export const getLevel = user => {
let ret = {
level: 0,
verified: false
};
if (typeof user !== "object")
return "user has to be an object!";
if (!user.prefix)
return ret;
let admin;
if(admin = config.admins.filter(e => e.prefix === user.prefix)[0]) {
ret = {
level: admin.level,
verified: true
};
}
return ret;
};