Trigger: user @USER

This commit is contained in:
Flummi 2016-08-30 19:24:44 +00:00
parent 20d6ed16a5
commit 787c6be5e2

View File

@ -1,14 +1,30 @@
module.exports = (bot, trigger, lib) => { module.exports = (bot, trigger, lib) => {
trigger.add({ trigger.add({
name: 'user', name: 'user',
call: /^\!user$/i, call: /^\!user( \@.*)?/i,
level: 0, level: 0,
active: 1, active: 1,
func: (e) => { func: (e) => {
//e.reply(e.user); var tmp = e.message.match(/^\!user( +@(.*))?/i);
lib.getUser(e, (cbgu) => { if(tmp[2].length) {
e.reply(cbgu); // e nachbauen xD
}); var etmp = {
network: e.network,
user: {
getNick: () => {
return tmp[2].trim();
}
}
};
lib.getUser(etmp, (cbgu) => {
e.reply(cbgu);
});
}
else {
lib.getUser(e, (cbgu) => {
e.reply(cbgu);
});
}
}, },
desc: 'get Userdata' desc: 'get Userdata'
}); });