uaf-cs / nookbot

BSD 3-Clause "New" or "Revised" License
6 stars 6 forks source link

Add a poll command #9

Open Arsh25 opened 3 years ago

Arsh25 commented 3 years ago

We often use Discord polling with emoticons. It would be neat to have a command that sets up the poll. It will read a structured message and then parse out the emoticons needed and add them as reactions.

The tricky part is building a structure that is easy for people to wrte and computers to parse. Maybe something like option emoji, option2 emoji ... will work?

mlemosf commented 3 years ago

I believe tokenzing the message string wich starts with a certain tag !poll for example, and then parsing each token to extract each unicode emoji could work. Then, when someone calls for !endpoll, the bot evaluates all valid votes and creates a summary. Can you explain to me how to run the bot locally and how to configure docker-compose.yaml?

katlyn commented 3 years ago

Keep in mind that we also want to make sure that we can use custom emoji for poss reactions, so just checking for unicode emoji won't be the best in this case - we'll also want to check for custom emoji. To set up the docker-compose.yaml you just need to fill out the environment variables listed therein. The most important for you to have if you're only working on the bot side of this are the variables prefixed with DISCORD_, and the rest can be filled with dummy values.

katlyn commented 3 years ago

I think it may be important to note that we're not too concerned with the !endpoll command, as people can look at the reactions on the bot message to view results fairly easily.

mlemosf commented 3 years ago

What do you think about this command structure and response?

!poll What is the best ice cream? ; Vanilla, :thumbsup: ; Chocolate, :point_down:

Poll : What is the best ice cream? Vanilla :thumbsup: Chocolate :point_down: