small bugfix
This commit is contained in:
parent
b71e20933d
commit
649e4339aa
|
@ -42,16 +42,18 @@ bot.on('motd', (e) => {
|
|||
|
||||
bot.on('message', (e) => {
|
||||
trigger.trigger.forEach((entry,i,a) => {
|
||||
if(entry.call.test(e.message) && entry.active == 1) {
|
||||
//if(entry.call.test(e.message) && entry.active == 1) {
|
||||
//if(e.message.match(new RegExp(entry.call, entry.flags)) && entry.active == 1) {
|
||||
if(e.message.match(entry.call) && entry.active == 1) {
|
||||
lib.log('trigger: '+entry.name);
|
||||
lib.getUserlevel(e, (cb) => {
|
||||
setTimeout(()=>{
|
||||
//setTimeout(()=>{
|
||||
if(cb.level >= entry.level) {
|
||||
entry.func(e);
|
||||
}
|
||||
else
|
||||
e.reply('no permission, min level '+entry.level+' required');
|
||||
}, 200);
|
||||
//}, 200);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -68,6 +70,7 @@ var trigger = {
|
|||
trigger.trigger.push({
|
||||
name: args.name,
|
||||
call: args.call,
|
||||
//flags: args.flags,
|
||||
func: args.func,
|
||||
desc: args.desc,
|
||||
level: args.level,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module.exports = (bot, trigger, lib) => {
|
||||
trigger.add({
|
||||
name: 'debug',
|
||||
call: new RegExp('^\\!debug$', 'i'),
|
||||
call: /^\!debug$/i,
|
||||
level: 100,
|
||||
active: 1,
|
||||
func: (e) => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module.exports = (bot, trigger, lib) => {
|
||||
trigger.add({
|
||||
name: 'delete',
|
||||
call: new RegExp('^\\!del (\\d+)$', 'i'),
|
||||
call: /^\!del (\d+)$/i,
|
||||
level: 100,
|
||||
active: 1,
|
||||
func: (e) => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module.exports = (bot, trigger, lib) => {
|
||||
trigger.add({
|
||||
name: 'level',
|
||||
call: new RegExp('^\\!level$', 'i'),
|
||||
call: /^\!level$/i,
|
||||
level: 0,
|
||||
active: 1,
|
||||
func: (e) => {
|
||||
|
|
|
@ -5,7 +5,7 @@ var path = require('path');
|
|||
module.exports = (bot, trigger, lib) => {
|
||||
trigger.add({
|
||||
name: 'parser',
|
||||
call: new RegExp('https?:\\/\\/[\\w-]+(\\.[\\w-]+)+\\.?(:\\d+)?(\\/\\S*)?', 'gi'),
|
||||
call: /https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi,
|
||||
level: 0,
|
||||
active: 1,
|
||||
func: (e) => {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
module.exports = (bot, trigger, lib) => {
|
||||
trigger.add({
|
||||
name: 'thumbnailer',
|
||||
call: new RegExp('^\\!thumb (\\d+)$', 'i'),
|
||||
call: /^\!thumb (\d+)$/i,
|
||||
level: 100,
|
||||
active: 1,
|
||||
func: (e) => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module.exports = (bot, trigger, lib) => {
|
||||
trigger.add({
|
||||
name: 'user',
|
||||
call: new RegExp('^\\!user$', 'i'),
|
||||
call: /^\!user$/i,
|
||||
level: 0,
|
||||
active: 1,
|
||||
func: (e) => {
|
||||
|
|
|
@ -6,7 +6,7 @@ var probe = require('node-ffprobe');
|
|||
module.exports = (bot, trigger, lib) => {
|
||||
trigger.add({
|
||||
name: 'ytdl',
|
||||
call: new RegExp('(https?://)?(www\\.)?(yotu\\.be/|youtube\\.com/)?((.+/)?(watch(\\?v=|.+&v=))?(v=)?)([\\w_-]{11})(&.+)?', 'gi'),
|
||||
call: /https?:\/\/(www\.)?(yotu\.be\/|youtube\.com\/)?((.+\/)?(watch(\?v=|.+&v=))?(v=)?)([\w_-]{11})(&.+)?/gi,
|
||||
level: 0,
|
||||
active: 0,
|
||||
func: (e) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user