This commit is contained in:
Flummi 2022-05-13 16:26:12 +00:00
parent ec438f45ef
commit 3f71519f81
13 changed files with 22 additions and 20 deletions

View File

@ -11,8 +11,8 @@
"author": "Flummi & jkhsjdhjs",
"license": "WTFPL",
"dependencies": {
"cleverbot-free": "^1.1.7",
"cuffeo": "^1.0.7-3",
"cleverbot-free": "^1.1.11",
"cuffeo": "^1.2.1",
"flumm-fetch-cookies": "^1.4.0",
"pg": "^8.3.0"
}

View File

@ -1,7 +1,7 @@
import _fs from "fs";
import repl from "repl";
import cuffeo from "cuffeo";
import config from "../cfg/config.json";
import config from "./inc/config.mjs";
import logger from "./inc/log.mjs";
import user from "./inc/user.mjs";

View File

@ -1,4 +1,4 @@
import config from "../../cfg/config.json";
import config from "./config.mjs";
export const getLevel = (network, user) => {
let ret = {

2
src/inc/config.mjs Normal file
View File

@ -0,0 +1,2 @@
import config from "../../cfg/config.json" assert { type: "json" };
export default config;

View File

@ -1,4 +1,4 @@
import PG from "pg";
import config from "../../cfg/config.json";
import config from "./config.mjs";
export default new PG.Pool(config.sql);

View File

@ -1,5 +1,5 @@
import fetch from "flumm-fetch-cookies";
import config from "../../../cfg/config.json";
import config from "../config.mjs";
export default async bot => {

View File

@ -3,7 +3,7 @@ export default async bot => {
return [{
name: "help",
call: /^(\.|\/)help/i,
active: false,
active: true,
f: e => {
if(e.args[0] && [...bot._trigger.keys()].includes(e.args[0])) {
const help = bot._trigger.get(e.args[0]).help;
@ -13,7 +13,7 @@ export default async bot => {
else {
let triggers = [];
[...bot._trigger.entries()]
.filter(trigger => trigger[1].help)
//.filter(trigger => trigger[1].help)
.forEach(trigger => triggers.push(trigger[0]));
e.reply(`(WIP) available commands: ${triggers.map(blah => `[b]${blah}[/b]`).join(", ")}`);
}

View File

@ -1,5 +1,5 @@
import fetch from "flumm-fetch-cookies";
import config from "../../../cfg/config.json";
import config from "../config.mjs";
const api = `https://robot-ws.your-server.de`;
const auth = {

View File

@ -1,5 +1,5 @@
import fetch from "flumm-fetch-cookies";
import config from "../../../cfg/config.json";
import config from "../config.mjs";
import user from "../user.mjs";
const api = `http://ws.audioscrobbler.com/2.0/?method=user.getRecentTracks&limit=1&api_key=${config.apis.lastfm.key}&format=json&user=`;
@ -25,7 +25,7 @@ export default async bot => {
return e.reply("nope");
const u = user.get(e.user.prefix);
if(u.lastfm === null || u.lastfm === "")
return e.reply("nope");
return e.reply("set up an account first: .np =username");
const res = await (await fetch(`${api}${u.lastfm}`)).json();
if(res.error)

View File

@ -1,5 +1,5 @@
import {default as fetch, cookieJar, Cookie} from "flumm-fetch-cookies";
import cfg from "../../../cfg/config.json";
import cfg from "../config.mjs";
const apis = {
reverse: "https://pr0gramm.com/api/items/get?flags=15&tags=!p:",

View File

@ -1,5 +1,5 @@
import fetch from "flumm-fetch-cookies";
import config from "../../../cfg/config.json";
import config from "../config.mjs";
export default async bot => {

View File

@ -25,11 +25,11 @@ export default async bot => {
return e.reply(meme.url);
}
}, {
name: "randomotter",
call: /^(\.|\/)otter$/i,
name: "randomvieh",
call: /^(\.|\/)(otter|bunny)$/i,
f: async e => {
const otter = await (await fetch("https://api.tinyfox.dev/img?animal=otter&json")).json();
return e.reply(`https://api.tinyfox.dev${otter.loc}`);
const vieh = await (await fetch(`https://api.tinyfox.dev/img?animal=${e.cmd}&json`)).json();
return e.reply(`https://api.tinyfox.dev${vieh.loc}`);
}
}]
};

View File

@ -1,5 +1,5 @@
import fetch from "flumm-fetch-cookies";
import config from "../../../cfg/config.json";
import config from "../config.mjs";
import { conds } from "./lib/wttr.mjs";
export default async bot => {