fixes detection whether last argument is a username or not

This commit is contained in:
jkhsjdhjs 2016-09-06 03:51:52 +02:00
parent ca21ce68c5
commit 4ebbcd1955

View File

@ -12,7 +12,7 @@ module.exports = (bot, trigger, lib) => {
var tmp = e.message.trim().split(' ');
tmp.shift();
var user = tmp[tmp.length - 1];
if(user.match(/(\+|-)/))
if(!(user in e.channel.names))
user = e.user.getNick();
else
tmp.pop();