f0ckv2/src/inc/admin.mjs
2021-12-04 12:19:47 +01:00

23 lines
406 B
JavaScript

import config from "./config.mjs";
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;
};