weniger deps

This commit is contained in:
Flummi 2018-09-14 22:09:56 +02:00
parent 4bf76135be
commit 04fd0ae17e
3 changed files with 2 additions and 47 deletions

View File

@ -10,12 +10,9 @@
"author": "Flummi & jkhsjdhjs", "author": "Flummi & jkhsjdhjs",
"license": "WTFPL", "license": "WTFPL",
"dependencies": { "dependencies": {
"discord.js": "^11.3.0",
"jsdom": "^11.12.0",
"long-timeout": "^0.1.1", "long-timeout": "^0.1.1",
"pg-promise": "^7.3.2", "pg-promise": "^7.3.2",
"stringify-object": "^3.2.1", "stringify-object": "^3.2.1",
"winston": "^2.4.0", "winston": "^2.4.0"
"ytdl-core": "^0.18.2"
} }
} }

View File

@ -10,7 +10,6 @@ import irpg from "./irpg";
import kernel from "./kernel"; import kernel from "./kernel";
import lastfm from "./lastfm"; import lastfm from "./lastfm";
import mcmaniac from "./mcmaniac"; import mcmaniac from "./mcmaniac";
import parser from "./parser";
import pr0gag from "./pr0gag"; import pr0gag from "./pr0gag";
import quotes from "./quotes"; import quotes from "./quotes";
import rape from "./rape"; import rape from "./rape";
@ -25,6 +24,6 @@ import wttr from "./wttr";
export default [ export default [
cfg, chatbot, coins, cookie, core, debug, cfg, chatbot, coins, cookie, core, debug,
drugs, help, irpg, kernel, lastfm, mcmaniac, drugs, help, irpg, kernel, lastfm, mcmaniac,
parser, pr0gag, quotes, rape, sandbox, soundcloud, pr0gag, quotes, rape, sandbox, soundcloud,
timer, urban, nxy, uwe, wttr timer, urban, nxy, uwe, wttr
]; ];

View File

@ -1,41 +0,0 @@
import fs from "fs";
import ytdl from "ytdl-core";
const _args = [
"--no-progress",
"--no-warnings",
"--no-check-certificate",
"--dump-json"
//"--max-filesize 500m",
//'-o "./tmp/%(title)s.%(ext)s"'
];
export default bot => {
bot._trigger.set("parser", new bot.trigger({
call: /https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi,
active: false,
clients: ["irc"],
f: e => {
if(e.network === "n0xy" && e.channel === "#kbot-dev") {
const links = e.message.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi);
Promise.all(links.map(link => checkRepost(link))) // repostcheck
.then(res => Promise.all(res.map(link => ytdl(link, _args)))) // info holen
.then(res => {
res.forEach(info => {
e.reply(info);
});
})
.catch(err => {
e.reply(err);
});
}
}
}));
};
function checkRepost(link) {
return new Promise((resolve, reject) => {
resolve(link);
});
}