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

@ -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 => {
@ -11,4 +11,4 @@ export default async bot => {
e.reply([ "Here are the top 3 Google results:", res.items.map((r, i) => `${i+1}: ${r.title} - ${r.link}`)].flat());
}
}];
};
};

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,10 +13,10 @@ 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 => {