This commit is contained in:
Flummi 2018-09-08 13:07:09 +02:00
parent 5177dbee5a
commit 31a633bda6
4 changed files with 4 additions and 18 deletions

View File

@ -1,6 +1,6 @@
import { irc as irclib } from "./src/clients/irc";
import { tg as tglib } from "./src/clients/tg";
import * as admins from "./src/inc/admin";
import { admins } from "./src/inc/admin";
import EventEmitter from "events";

View File

@ -4,7 +4,6 @@
"description": "lul",
"main": "index.mjs",
"scripts": {
"start": "node --experimental-modules test.mjs"
},
"repository": {
"type": "git",

View File

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

View File

@ -1,9 +0,0 @@
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);
});