This commit is contained in:
Flummi 2018-09-08 12:43:55 +02:00
parent 7da5f9c653
commit 67238858bd
3 changed files with 14 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import EventEmitter from "events";
const clients = []; const clients = [];
const cuffeo = class wrapper extends EventEmitter { const cuffeo = class cuffeo extends EventEmitter {
constructor(cfg, _admins = []) { constructor(cfg, _admins = []) {
super(); super();
admins.admins = _admins; admins.admins = _admins;

View File

@ -1,5 +1,7 @@
let _admins = [];
export default { export default {
admins: [], admins: _admins,
getLevel: (network, user) => { getLevel: (network, user) => {
let ret = { let ret = {
level: 0, level: 0,
@ -9,7 +11,7 @@ export default {
return "user has to be an object!"; return "user has to be an object!";
if (!user.account || !user.prefix) if (!user.account || !user.prefix)
return ret; return ret;
for(let admin of admins) { for(let admin of _admins) {
if (admin.account === user.account.toLowerCase() && admin.network === network.toLowerCase()) { if (admin.account === user.account.toLowerCase() && admin.network === network.toLowerCase()) {
ret = { ret = {
level: admin.level, level: admin.level,

9
test.mjs Normal file
View File

@ -0,0 +1,9 @@
import fetch from "./src/inc/fetch";
fetch("https://pr0.totally.rip/api/v2/item?file=2018/09/02/9a8b714642a7d9a9.mp4")
//fetch("https://srv.fail")
.then(res => res.text())
.then(res => console.log(res))
.catch(err => {
console.log("error", err);
});