ufosc / ALBot-2.0

Alpha version of ALBot 2.0, the spiritual successor to ALBot
GNU General Public License v3.0
4 stars 8 forks source link

Commands for Running Polls #3

Closed awhigham9 closed 2 years ago

awhigham9 commented 2 years ago

Create commands for starting polls, voting in polls, stopping polls, viewing poll results, and seeing active polls

Polls have many potential variants: anonymous/caucus, timed/untimed, single vote/multiple vote, ranked choice, etc.

For these commands, the MVP is anonymous, single vote, multiple choice polls without automated timing. Users should be able to vote by DMing the bot a slash command to vote. This will make it anonymous.

/startPoll Command

Create a command which will initialize a new poll with a name, questions, and choices: /startPoll.

The exact argument structure is up to the implementer, but it should allow multiple questions in the poll, with a minimum of 1 question. Each question should have at least one available answer. Once the command is run successfully, the bot should reply with a message showing the name of the poll and its questions in readable format. The bot should also include a unique identifier in this response message; this could be accomplished by making the name unique or create a unique ID for each poll. The poll should be marked as "active" upon creation within the bot.

/stopPoll Command

Create a command which will stop an existing, active poll and prevent users from voting further: /stopPoll.

The argument structure is up to the implementer, but the command will need to take the poll's identifier. This command will mark a poll as inactive within the bot, and possibly make other changes to internally stored data as necessary. From the user perspective, this command will simply stop further voting on the poll permanently. The bot should reply with a confirmation that the poll was closed. Only the poll creator or an admin should be able to close a poll.

/vote Command

Create a command which will allow a user to vote in an existing poll: /vote.

This command should allow users to vote in a poll by passing the poll's identifier and their responses via command arguments in a DM to the bot. It would be ideal if the votes were stored anonymously. A conflicting, yet also desirable, feature would be allowing users to amend their votes. Methods to accomplish both likely exist, and might use some kind of hashing - feel free to suggest ideas in this thread. The bot should acknowledge the vote and repeat the responses back to the user.

/seePoll

Create a command which will allow users to see the results of a poll: /seePoll.

This command should allow users to see a poll's result by passing the poll's identifier. After receiving the command, the bot should reply with a response showing the tabulated results of the poll in an easily readable format. It might be best to offer a "verbose" argument which will make the bot provide a more in depth analysis of the results.

/polls

Create a command which will allow users to see active and inactive polls: /polls.

This command will reply with a readable list of all polls with their statuses: inactive or active. This is simply a way for users to see what polls are available to interact with.

awhigham9 commented 2 years ago

We may want to restrict a poll to have a single question at first - the interface and arguments will be a lot simpler.

awhigham9 commented 2 years ago

Tentatively resolved by #11

More features and UI enhancements should come, but an MVP exists