defendtheweb / NexBot

Node.js IRC bot
Other
8 stars 8 forks source link

!poll #66

Closed lwward closed 10 years ago

lwward commented 10 years ago

A module to allow any user to run and vote on a poll.

Example:

!poll <Title>
NexBot: Poll started - <Title>
!vote <blah>
!vote <blah2>
!vote <blah>
!poll end
NexBot: <blah> wins. <blah> (2 vote), <blah2> (1 vote)

If a poll is already running

!poll <Title>
NexBot: A poll is already running - <Title>

!poll
NexBot: Current poll: <title>

Poll results should be sent to HackThis!! via a new API call that collates all previous polls and results.

PMaynard commented 10 years ago

Bonus: On start of poll the topic is updated with the poll title, and on poll end the topic displays the winning vote.

This needs to be intelligent so it does not lose the old topic.

lwward commented 10 years ago

If someone double votes should the second overwrite the first?

PMaynard commented 10 years ago

Assuming that the votes are stored in a temporary array [User => Vote] then it should overwrite the value.

PMaynard commented 10 years ago

8771f2e85256f7727eb9c3b8b6076f4d83b07c0a - I'm going to leave this open, because it would be nice to have the topic change. Again weekend hack..