Skip to content

Releases: wrussell1999/food-flex-discord

Version 2.0.2

11 Feb 23:30
Compare
Choose a tag to compare

Fixes

  • Require discord.py v1.2.5 because Discord changed their API and broke v1.2.3

Version 2.0.1

29 Sep 17:09
Compare
Choose a tag to compare

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

19 Sep 20:27
Compare
Choose a tag to compare

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.
    image
  • 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 called voting_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

12 Jun 14:28
Compare
Choose a tag to compare

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

10 Jun 01:38
Compare
Choose a tag to compare

Fixes

  • Voting letters are now displayed in alphabetical order

Dictionary based data structures

09 Jun 03:03
Compare
Choose a tag to compare

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

31 May 01:20
Compare
Choose a tag to compare

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

28 Apr 23:30
Compare
Choose a tag to compare
  • 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

05 May 00:26
Compare
Choose a tag to compare

Works with discord.py 1.1.0a. Also, fixed and refactored scoring system. All commands are documented under "Wiki".

Result bugs fixed

02 May 20:34
Compare
Choose a tag to compare

Bugs relating to getting the winner, and scoring system have been fixed.