From 4d01187346ed57430ee85afc793286630e16affe Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 21 Jan 2013 19:30:06 +0000 Subject: [PATCH] Show voting options in ~pdesc [#155] --- modules/poll/commands.js | 11 +++++++++-- modules/poll/strings.json | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/poll/commands.js b/modules/poll/commands.js index bcd8530..ac36252 100644 --- a/modules/poll/commands.js +++ b/modules/poll/commands.js @@ -98,7 +98,7 @@ var commands = function(dbot) { if(_.has(polls, name)) { if(_.has(polls[name].votes, vote)) { if(_.has(polls[name].votees, user)) { - var oldVote = polls[name].votees[event.user]; + var oldVote = polls[name].votees[user]; polls[name].votes[oldVote]--; polls[name].votes[vote]++; polls[name].votees[user] = vote; @@ -131,6 +131,13 @@ var commands = function(dbot) { var name = event.input[1].toLowerCase(); if(_.has(polls, name)) { + var options = _.keys(polls[name].votes); + var optionString = " Choices: "; + for(var i=0;i