commit
411a65d228
@ -1,3 +1,5 @@
|
||||
blah
|
||||
|
||||
how to install:
|
||||
|
||||
1. install ffmpeg
|
||||
@ -5,4 +7,4 @@ how to install:
|
||||
3. npm i
|
||||
4. edit config in ./cfg/
|
||||
5. npm start (or ./start.sh)
|
||||
6. gtfo!
|
||||
6. gtfo!
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "keinBotv2",
|
||||
"version": "0.1.1",
|
||||
"version": "0.2.0",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
"start": "node ./bot.js"
|
||||
|
@ -12,42 +12,46 @@ module.exports = (lib) => {
|
||||
var name = args[1].replace('@','');
|
||||
var level = (args[2]>=100)?100:args[2];
|
||||
|
||||
if( name in e.channel.names ) {
|
||||
lib.bot.whois(name.trim(), e.network, (err, data) => {
|
||||
if(!err) {
|
||||
if(data.account !== null) {
|
||||
var userstring = (data.nick === data.account)?data.nick:(data.nick+' ('+data.account+')');
|
||||
if(data.account in lib.admins) {
|
||||
if(level <= 0) {
|
||||
lib.sql.query('delete from `f0ck`.`user` where `id` = ? limit 1', [lib.admins[data.account].id], () => {
|
||||
lib.loadUser();
|
||||
applyModes(lib, data.channels[e.channel], level, e.channel, data.nick);
|
||||
e.reply('deleted user '+userstring);
|
||||
});
|
||||
if(name.toLowerCase() != lib.bot.me.nick.toLowerCase()) {
|
||||
if( name in e.channel.names ) {
|
||||
lib.bot.whois(name.trim(), e.network, (err, data) => {
|
||||
if(!err) {
|
||||
if(data.account !== null) {
|
||||
var userstring = (data.nick === data.account)?data.nick:(data.nick+' ('+data.account+')');
|
||||
if(data.account in lib.admins) {
|
||||
if(level <= 0) {
|
||||
lib.sql.query('delete from `f0ck`.`user` where `id` = ? limit 1', [lib.admins[data.account].id], () => {
|
||||
lib.loadUser();
|
||||
applyModes(lib, data.channels[e.channel], level, e.channel, data.nick);
|
||||
e.reply('deleted user '+userstring);
|
||||
});
|
||||
}
|
||||
else {
|
||||
lib.sql.query('update `f0ck`.`user` set `level` = ? where `id` = ?', [level, lib.admins[data.account].id], () => {
|
||||
lib.loadUser();
|
||||
applyModes(lib, data.channels[e.channel], level, e.channel, data.nick);
|
||||
e.reply('changed user '+userstring+' to level '+level);
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
lib.sql.query('update `f0ck`.`user` set `level` = ? where `id` = ?', [level, lib.admins[data.account].id], () => {
|
||||
lib.sql.query('insert into `f0ck`.`user` (`account`,`level`,`network`) values (?,?,?)', [data.account, level, e.network], () => {
|
||||
lib.loadUser();
|
||||
applyModes(lib, data.channels[e.channel], level, e.channel, data.nick);
|
||||
e.reply('changed user '+userstring+' to level '+level);
|
||||
e.reply('added new user '+userstring+' with level '+level);
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
lib.sql.query('insert into `f0ck`.`user` (`account`,`level`,`network`) values (?,?,?)', [data.account, level, e.network], () => {
|
||||
lib.loadUser();
|
||||
applyModes(lib, data.channels[e.channel], level, e.channel, data.nick);
|
||||
e.reply('added new user '+userstring+' with level '+level);
|
||||
});
|
||||
}
|
||||
else
|
||||
e.reply('user '+data.nick+' isn\'t registered');
|
||||
}
|
||||
else
|
||||
e.reply('user '+data.nick+' isn\'t registered');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
e.reply('user '+name+' not found');
|
||||
}
|
||||
else
|
||||
e.reply('user '+name+' not found');
|
||||
e.reply('f0ck you hard');
|
||||
}
|
||||
else
|
||||
e.reply('no permission, min level 100 required');
|
||||
|
@ -40,7 +40,7 @@ module.exports = (lib) => {
|
||||
(cb.info.thumb !== null)?cb.info.thumb:''
|
||||
]).on('result', (result) => {
|
||||
lib.generateThumbs();
|
||||
e.reply("https://f0ck.me/"+result.insertId+" - "+cb.info.title+" ("+cb.info.mime+", ~"+lib.formatSize(cb.size)+") from "+cbgu['nick']+" ("+cbgu['username']+"@"+cbgu['hostname']+")");
|
||||
e.reply(cfg.url+"/"+result.insertId+" - "+cb.info.title+" ("+cb.info.mime+", ~"+lib.formatSize(cb.size)+") from "+cbgu['nick']+" ("+cbgu['username']+"@"+cbgu['hostname']+")");
|
||||
}).on('error', (msg) => {
|
||||
e.reply(msg);
|
||||
});
|
||||
@ -191,7 +191,7 @@ module.exports = (lib) => {
|
||||
cb({ success: false, msg: 'lol, go f0ck yourself ('+mime+')' });
|
||||
}
|
||||
else
|
||||
cb({ success: false, msg: 'repost motherf0cker: https://f0ck.me/'+cbcrcs });
|
||||
cb({ success: false, msg: 'repost motherf0cker: '+cfg.url+'/'+cbcrcs });
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -202,7 +202,7 @@ module.exports = (lib) => {
|
||||
});
|
||||
}
|
||||
else
|
||||
cb({ success: false, msg: 'repost motherf0cker: https://f0ck.me/'+cbcr });
|
||||
cb({ success: false, msg: 'repost motherf0cker: '+cfg.url+'/'+cbcr });
|
||||
});
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue
Block a user