Releases: wrussell1999/food-flex-discord
Version 2.0.2
Fixes
- Require
discord.py
v1.2.5 because Discord changed their API and broke v1.2.3
Version 2.0.1
Fixes
- The font used on the images is now bundled with the bot
- Bot no longer crashes when trying to remind people to vote
- Bot now responds to commands in any channel
- DM to remind people to vote is now coloured red as it should be
Changes
- Improved install instructions
Version 2.0.0
Features
- When voting begins, all pictures are reposted with the letter to vote for them added in the corner. (closes #9) π π π π
- EXIF rotation information is parsed and used to correctly rotate images for the voting stage.
- The bot can be killed and resumed at any point in the submission/voting/results periods.
- The file loading and parsing modules give useful errors in the case of malformed configs or corrupted state information.
- Improved log severity level usage makes important information easily visible but keeps the log file somewhat concise.
Rework of commands
Commands have been simplified and there are now only 6 of them. All commands can only be used by admins (as defined in the config file). The bot's command prefix is also configurable in the config file.
The bot now has two distinct ways (modes) of deciding when to switch between periods:
- automatic mode - the bot automatically switches period at the times of day set out in the README.
- manual mode - the bot ignores the time and only switches when given a command to do so.
Commands:
submit
- open submissions (and switch to manual mode).vote
- open voting (and switch to manual mode).result
- display the results of the voting (and switch to manual mode).automatic
- switch back to automatic mode.version
- check which release (and specific commit) of the bot is in use.state
- dump the bot's state to a text channel for debugging.
Changes
- The project has been extensively re-factored to improve readability, configurability and reliability.
- The updated README walks you through installing, setting up and configuring the bot.
- Many unused but imported modules have been removed.
- The config file is now gitignored and untracked. This means you cannot accidentally commit your bot's token to GitHub!
- The bot now only requires two channels to be configured: the main submission/voting/results channel and a channel for the leaderboard.
- The references to these channels are now cached and no longer passed between modules unnecessarily.
requirements.txt
now specifies the exact version of each dependency.letter_to_user_id_map
is now calledvoting_map
.config/
folder holds the config for the bot.data/
folder holds all generated state information.static/
folder holds all static resources.- .gitignore has been rewritten to only include files relevant to this project.
after_invoke
hook means the message that sent a command can be deleted without having to repeat that code in every command handler.- Many misc. code readability improvements.
Version 1.3.2
Fixes
- A data structure that was incorrectly not cleared each day is now cleared each day. This prevents the program crashing on the second day of operation.
Version 1.3.1
Fixes
- Voting letters are now displayed in alphabetical order
Dictionary based data structures
Everything has been changed:
- All channels have been merged to one
- All commands are in
commands.py
- Voting now allows for the
π ±οΈ emoji - Leaderboard is now a single message that is edited
- Users are now stored as a dictionary (see below)
{
"daily_data": {
"1234567890": {
"nick": "Will",
"submitted": false,
"voted": false,
"votes": 1
},
"2345678901": {
"nick": "Dan",
"submitted": true,
"voted": true,
"votes": 0
}
},
"letter_to_user_id": {
"1234567890": "A",
"2345678901": "B"
}
}
Packages implemented
Packages implemented to improve readability. Also fixed an error with disqualifying the winner if they didn't vote.
New structure:
βββ config
βΒ Β βββ config.json
βββ data
βΒ Β βββ daily_data.json
βΒ Β βββ foodflex.log
βΒ Β βββ quotes.json
βΒ Β βββ scoreboard.json
βββ foodflex
βΒ Β βββ foodflex.py
βΒ Β βββ __init__.py
βΒ Β βββ __main__.py
βΒ Β βββ periods
βΒ Β βΒ Β βββ messages.py
βΒ Β βΒ Β βββ results.py
βΒ Β βΒ Β βββ scoreboard.py
βΒ Β βΒ Β βββ submissions.py
βΒ Β βΒ Β βββ voting.py
βΒ Β βββ util
βΒ Β βββ config.py
βΒ Β βββ data.py
βΒ Β βββ flex_commands.py
βΒ Β βββ setup_period.py
βββ LICENSE
βββ README.md
With the introduction of packages, the way to run the bot has changed.
Before
python3 main.py
After
python3 -m foodflex
I've also implemented the use of a virtual environment. Instructions can be found in the README.
University Term 3 Release
- Supports discord.py v1.0.1
- Code now split between files for readability
- Displays a presence and status during the different periods
- Ownership is now bound to bot, rather than comparing user IDs.
- Server data is ignored by git
- README updated with instructions
Food Flex is ready for Term 3!
All features work in refactor and with discord.py API 1.1.0a
Works with discord.py 1.1.0a. Also, fixed and refactored scoring system. All commands are documented under "Wiki".
Result bugs fixed
Bugs relating to getting the winner, and scoring system have been fixed.