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) => {
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) => {
if(cb.level >= entry.level)
entry.func(e);

View File

@ -3,6 +3,7 @@ module.exports = (bot, trigger, lib) => {
name: 'delete',
call: new RegExp('^\\!del (\\d+)$', 'i'),
level: 100,
active: 1,
func: (e) => {
var id = e.message.split(' ')[1];
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',
call: new RegExp('^\\!level$', 'i'),
level: 0,
active: 1,
func: (e) => {
lib.getUserlevel(e, (cb) => {
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',
call: new RegExp('https?:\\/\\/[\\w-]+(\\.[\\w-]+)+\\.?(:\\d+)?(\\/\\S*)?', 'gi'),
level: 0,
active: 1,
func: (e) => {
if(e.channel.getName() == '#f0ck') {
if(!e.message.match(/\!ignore$/)) {

View File

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

View File

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