forked from GitHub/dbot
wrote some of viewpoll. Hello dan.
This commit is contained in:
parent
ffd383365e
commit
d012ff4394
@ -34,7 +34,7 @@ var poll = function(dbot) {
|
|||||||
var vote = event.input[2];
|
var vote = event.input[2];
|
||||||
|
|
||||||
if(polls.hasOwnProperty(name)) {
|
if(polls.hasOwnProperty(name)) {
|
||||||
if(event.user in polls[name].votees) {
|
if(polls[name].votees.include(event.user)) {
|
||||||
event.reply(dbot.t('alread_voted'));
|
event.reply(dbot.t('alread_voted'));
|
||||||
} else {
|
} else {
|
||||||
if(polls[name].votes.hasOwnProperty(vote)) {
|
if(polls[name].votes.hasOwnProperty(vote)) {
|
||||||
@ -50,16 +50,18 @@ var poll = function(dbot) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
'~rmpoll': function(event) {
|
'~viewpoll': function(event) {
|
||||||
|
var name = event.input[1];
|
||||||
},
|
if(polls.hasOwnProperty(name)) {
|
||||||
|
|
||||||
'~results': function(event) {
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
event.reply(dbot.t('poll_unexistent'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
commands['~newpoll'].regex = [/~newpoll ([^ ]+) \[options=([^ ]+)\] (.+)/, 4];
|
commands['~newpoll'].regex = [/~newpoll ([^ ]+) \[options=([^ ]+)\] (.+)/, 4];
|
||||||
commands['~vote'].regex = [/~vote ([^ ]+) ([^ ]+)/, 3];
|
commands['~vote'].regex = [/~vote ([^ ]+) ([^ ]+)/, 3];
|
||||||
|
commands['~viewpoll'].regex = [/~viewpoll ([^ ]+)/, 2];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'name': 'poll',
|
'name': 'poll',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user