mirror of
https://github.com/reality/dbot.git
synced 2024-12-28 13:42:36 +01:00
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];
|
||||
|
||||
if(polls.hasOwnProperty(name)) {
|
||||
if(event.user in polls[name].votees) {
|
||||
if(polls[name].votees.include(event.user)) {
|
||||
event.reply(dbot.t('alread_voted'));
|
||||
} else {
|
||||
if(polls[name].votes.hasOwnProperty(vote)) {
|
||||
@ -50,16 +50,18 @@ var poll = function(dbot) {
|
||||
}
|
||||
},
|
||||
|
||||
'~rmpoll': function(event) {
|
||||
|
||||
},
|
||||
|
||||
'~results': function(event) {
|
||||
'~viewpoll': function(event) {
|
||||
var name = event.input[1];
|
||||
if(polls.hasOwnProperty(name)) {
|
||||
|
||||
} else {
|
||||
event.reply(dbot.t('poll_unexistent'));
|
||||
}
|
||||
}
|
||||
};
|
||||
commands['~newpoll'].regex = [/~newpoll ([^ ]+) \[options=([^ ]+)\] (.+)/, 4];
|
||||
commands['~vote'].regex = [/~vote ([^ ]+) ([^ ]+)/, 3];
|
||||
commands['~viewpoll'].regex = [/~viewpoll ([^ ]+)/, 2];
|
||||
|
||||
return {
|
||||
'name': 'poll',
|
||||
|
Loading…
Reference in New Issue
Block a user