wrussell1999 / food-flex-discord

🍔 Discord bot for rating your friends food
https://foodflex.wrussell.co.uk
MIT License
15 stars 3 forks source link

Vote handling #6

Closed wrussell1999 closed 5 years ago

wrussell1999 commented 5 years ago

In the data branch, we are moving from using lists to dictionary per user. The structure looks like this:

"user_unique_id": {
    "nick": "Will",
    "submitted": false,
    "voted": true,
    "votes": 0,
    "vote_index": null
}

vote_index needs to be changed to a more reliable, and readable solution. Also, votes will be set to 0 for everyone by default.

When someone submits, it creates a dictionary for them. When someone votes, it creates a dictionary for them, if one doesn't already exist. Just got to make sure that when the results are posted, it only posts the people who submitted (check the submitted field).

danielfspencer commented 5 years ago

80e764bab77bb9ee56547e3c3ebe2082046dbe37 fixes this by removing vote_index