ja
This commit is contained in:
parent
d437b580f3
commit
3b2c79275f
@ -11,9 +11,8 @@
|
|||||||
"author": "Flummi & jkhsjdhjs",
|
"author": "Flummi & jkhsjdhjs",
|
||||||
"license": "WTFPL",
|
"license": "WTFPL",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cuffeo": "^1.0.5-2",
|
"cuffeo": "^1.0.6",
|
||||||
"flumm-fetch-cookies": "^1.3.4-1",
|
"flumm-fetch-cookies": "^1.3.5",
|
||||||
"pg": "^7.14.0",
|
"pg": "^7.14.0"
|
||||||
"stringify-object": "^3.3.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import _fs from "fs";
|
import _fs from "fs";
|
||||||
|
import repl from "repl";
|
||||||
import cuffeo from "cuffeo";
|
import cuffeo from "cuffeo";
|
||||||
import config from "../cfg/config.json";
|
import config from "../cfg/config.json";
|
||||||
import logger from "./inc/log.mjs";
|
import logger from "./inc/log.mjs";
|
||||||
@ -53,4 +54,11 @@ const timeout = 1000;
|
|||||||
|
|
||||||
console.timeEnd("loading");
|
console.timeEnd("loading");
|
||||||
|
|
||||||
|
const r = repl.start({
|
||||||
|
prompt: "> ",
|
||||||
|
useGlobal: true,
|
||||||
|
ignoreUndefined: true
|
||||||
|
});
|
||||||
|
r.context.self = self;
|
||||||
|
r.context.user = user;
|
||||||
})();
|
})();
|
||||||
|
@ -17,11 +17,38 @@ let context = vm.createContext({
|
|||||||
export default async bot => {
|
export default async bot => {
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
name: "tmp",
|
name: "trigger",
|
||||||
call: /^\.penis/i,
|
call: /^\.trigger/i,
|
||||||
|
level: 100,
|
||||||
f: async e => {
|
f: async e => {
|
||||||
console.log(e);
|
switch(e.args[0]) {
|
||||||
e.reply("schau in die Konsole lol");
|
case "add":
|
||||||
|
try {
|
||||||
|
let args = e.args.slice(1);
|
||||||
|
const match = args.join` `.match(/^\/(?<regex>.*)\/(?<flags1>(?!\\)[gimy]+)?(?<flags>[gimy]+)?\s(?<cmd>.*)/).groups;
|
||||||
|
|
||||||
|
const blah = {
|
||||||
|
orig: args.join` `,
|
||||||
|
regex: match.regex,
|
||||||
|
flags: (match.flags1 ? match.flags1 : "") + (match.flags ? match.flags : ""),
|
||||||
|
cmd: match.cmd
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
blah
|
||||||
|
);
|
||||||
|
|
||||||
|
} catch(err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "del":
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "level",
|
name: "level",
|
||||||
|
@ -27,16 +27,14 @@ export default async bot => {
|
|||||||
if(u.lastfm === null || u.lastfm === "")
|
if(u.lastfm === null || u.lastfm === "")
|
||||||
return e.reply("nope");
|
return e.reply("nope");
|
||||||
|
|
||||||
let res = await (await fetch(`${api}${u.lastfm}`)).json();
|
const res = await (await fetch(`${api}${u.lastfm}`)).json();
|
||||||
if(res.error)
|
if(res.error)
|
||||||
return e.reply("User not found");
|
return e.reply("User not found");
|
||||||
|
|
||||||
res = res.recenttracks;
|
|
||||||
const track = res.track[0];
|
|
||||||
const info = {
|
const info = {
|
||||||
user: res["@attr"].user,
|
user: e.user.nick, //res["@attr"].user,
|
||||||
track: `${track.artist["#text"]} - ${track.name}`,
|
track: `${res.recenttracks.track[0].artist["#text"]} - ${res.recenttracks.track[0].name}`,
|
||||||
playing: track["@attr"] ? true : false
|
playing: !!res.recenttracks.track[0]["@attr"]
|
||||||
};
|
};
|
||||||
|
|
||||||
return e.reply(info.playing ?
|
return e.reply(info.playing ?
|
||||||
|
@ -30,7 +30,7 @@ export default async bot => {
|
|||||||
f: async e => {
|
f: async e => {
|
||||||
const user = await ts();
|
const user = await ts();
|
||||||
|
|
||||||
e.reply(`aktuell ${user.length === 1 ? "ist" : "sind"} ${user.length} Nase${user.length === 1 ? "" : "n"} mit f0ck.space verbunden${user.length === 0 ? "." : ": " }${user.join(", ")}`);
|
e.reply(`aktuell ${user.length === 1 ? "ist" : "sind"} ${user.length} Nase${user.length === 1 ? "" : "n"} mit f0ck.space verbunden${user.length === 0 ? "." : ": " }${user.join(", ").replace(/\\s/, " ")}`);
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user