From 17bd41d3ef17fbbb4a60ac661b4004db84a32eab Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 7 Sep 2013 18:12:02 +0000 Subject: [PATCH] fix the chain --- modules/command/api.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/command/api.js b/modules/command/api.js index 47f9d6f..e42d3cb 100644 --- a/modules/command/api.js +++ b/modules/command/api.js @@ -19,9 +19,14 @@ var api = function(dbot) { if(accessNeeded == 'voice') { allowedNicks = _.union(allowedNicks, dbot.config.moderators); allowedNicks = _.union(allowedNicks, dbot.config.power_users); - allowedNicks = _.union(allowedNicks, _.filter(channel.nicks, function(nick) { - return nick.op == true || nick.voice == true; - })); + allowedNicks = _.union(allowedNicks, + _.chain(channel.nicks) + .filter(function(nick) { + return nick.op == true || nick.voice == true; + }) + .pluck('name') + .value()); + console.log(allowedNicks); } if(!_.include(allowedNicks, user.primaryNick)) {