This commit is contained in:
Flummi 2016-08-24 07:55:40 +00:00
parent b34e63ce0e
commit 334ef5bb2a
6 changed files with 7 additions and 10 deletions

View File

@ -42,7 +42,7 @@ bot.on('motd', (e) => {
bot.on('message', (e) => { bot.on('message', (e) => {
trigger.trigger.forEach((entry,i,a) => { trigger.trigger.forEach((entry,i,a) => {
if(entry.call.test(e.message)) { if(entry.call.test(e.message) && entry.active == 1) {
lib.getUserlevel(e, (cb) => { lib.getUserlevel(e, (cb) => {
if(cb.level >= entry.level) if(cb.level >= entry.level)
entry.func(e); entry.func(e);

View File

@ -3,6 +3,7 @@ module.exports = (bot, trigger, lib) => {
name: 'delete', name: 'delete',
call: new RegExp('^\\!del (\\d+)$', 'i'), call: new RegExp('^\\!del (\\d+)$', 'i'),
level: 100, level: 100,
active: 1,
func: (e) => { func: (e) => {
var id = e.message.split(' ')[1]; var id = e.message.split(' ')[1];
lib.sql.query("delete from `f0ck`.`items` where `id` = ?", id).on('end', () => { lib.sql.query("delete from `f0ck`.`items` where `id` = ?", id).on('end', () => {

View File

@ -3,6 +3,7 @@ module.exports = (bot, trigger, lib) => {
name: 'level', name: 'level',
call: new RegExp('^\\!level$', 'i'), call: new RegExp('^\\!level$', 'i'),
level: 0, level: 0,
active: 1,
func: (e) => { func: (e) => {
lib.getUserlevel(e, (cb) => { lib.getUserlevel(e, (cb) => {
e.reply("level from "+e.user.getNick()+": "+cb.level+" (Channel: "+cb.channel+" DB: "+cb.db+")"); e.reply("level from "+e.user.getNick()+": "+cb.level+" (Channel: "+cb.channel+" DB: "+cb.db+")");

View File

@ -7,6 +7,7 @@ module.exports = (bot, trigger, lib) => {
name: 'parser', name: 'parser',
call: new RegExp('https?:\\/\\/[\\w-]+(\\.[\\w-]+)+\\.?(:\\d+)?(\\/\\S*)?', 'gi'), call: new RegExp('https?:\\/\\/[\\w-]+(\\.[\\w-]+)+\\.?(:\\d+)?(\\/\\S*)?', 'gi'),
level: 0, level: 0,
active: 1,
func: (e) => { func: (e) => {
if(e.channel.getName() == '#f0ck') { if(e.channel.getName() == '#f0ck') {
if(!e.message.match(/\!ignore$/)) { if(!e.message.match(/\!ignore$/)) {

View File

@ -3,6 +3,7 @@ module.exports = (bot, trigger, lib) => {
name: 'user', name: 'user',
call: new RegExp('^\\!user$', 'i'), call: new RegExp('^\\!user$', 'i'),
level: 0, level: 0,
active: 1,
func: (e) => { func: (e) => {
//e.reply(e.user); //e.reply(e.user);
lib.getUser(e, (cbgu) => { lib.getUser(e, (cbgu) => {

View File

@ -8,6 +8,7 @@ module.exports = (bot, trigger, lib) => {
name: 'ytdl', name: 'ytdl',
call: new RegExp('(https?://)?(www\\.)?(yotu\\.be/|youtube\\.com/)?((.+/)?(watch(\\?v=|.+&v=))?(v=)?)([\\w_-]{11})(&.+)?', 'gi'), call: new RegExp('(https?://)?(www\\.)?(yotu\\.be/|youtube\\.com/)?((.+/)?(watch(\\?v=|.+&v=))?(v=)?)([\\w_-]{11})(&.+)?', 'gi'),
level: 0, level: 0,
active: 0,
func: (e) => { func: (e) => {
if(e.channel.getName() == '#f0ck') { if(e.channel.getName() == '#f0ck') {
if(!e.message.match(/\!ignore$/)) { if(!e.message.match(/\!ignore$/)) {
@ -18,15 +19,7 @@ module.exports = (bot, trigger, lib) => {
lib.checkRepost(entry, (cbcr) => { lib.checkRepost(entry, (cbcr) => {
if(cbcr) { if(cbcr) {
var dat = fs.createWriteStream('./b/'+tmpdest+'.webm'); var dat = fs.createWriteStream('./b/'+tmpdest+'.webm');
ytdl(entry, { filter: (format) => { ytdl(entry, { filter: (format) => { return format.container === 'webm'; } })
try {
return format.container === 'webm';
}
catch(ex) {
dl = false;
e.reply("noep D:");
}
} })
.on('response', (res) => { .on('response', (res) => {
if(res.headers['content-length'] > lib.cfg.maxFileSize) { if(res.headers['content-length'] > lib.cfg.maxFileSize) {
res.destroy(); res.destroy();