:D wrong func

This commit is contained in:
Flummi 2016-12-30 19:17:39 +01:00
parent 400bf4aa4b
commit ff9a170988

View File

@ -8,19 +8,18 @@ var request = require('request');
var ytdl = require('ytdl-core');
var Readable = require('stream').Readable;
module.exports = (lib, userlevel) => {
module.exports = (lib) => {
lib.trigger.add({
name: 'parser',
call: /https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi,
level: 0,
active: 0,
func: (e) => {
func: (e, userlevel) => {
if(e.channel.getName() === lib.cfg.main.debugchannel || e.message.match(/(!|-)f0ck/i)) {
if(!e.message.match(/(!|-)ignore/)) {
var tmp = e.message.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi); // get links
tmp.forEach((entry,i,a) => {
if(!entry.match(/f0ck\.me/i) && !entry.match(/\.onion/i)) {
e.reply("level: "+userlevel); // tmp
getLink(entry, ((e.message.match(/(!|-)force/i) && userlevel >= 100)?true:false), (cb) => {
if(cb.success === true) {
fs.move(cb.file, cb.file + '.' + cb.info.ext, (err) => {
@ -66,7 +65,6 @@ module.exports = (lib, userlevel) => {
});
var getLink = (url, force, cb) => {
lib.log("force: "+(force?"true":"false"));
var yt = /https?:\/\/(www\.)?youtu(\.be\/|be\.com\/)((.+\/)?(watch(\?v=|.+&v=))?(v=)?)([\w_-]{11})(&.+)?/gi;
var sc = /https?:\/\/(www\.)?(soundcloud\.com|snd\.sc)(\/\S*)(\/\S*)/gi;
lib.checkRepost(url, (cbcr) => {