A Discord bot for the Paradiso movie voting system, using Algolia for data storage.
- Add movies to a voting queue
- Vote for movies
- Search for movies by title, actor, director, etc.
- Find related movies
- See top voted movies
- List all movies in the voting queue
- Python 3.9+
- discord.py
- python-dotenv
- algoliasearch
- requests
- pytest (for testing)
- Clone this repository
- Set up a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile based on.env-example - Create an Algolia account and set up indices:
- Create an application in Algolia
- Create two indices:
paradiso_moviesandparadiso_votes
Create a .env file in the project root with the following variables:
# Discord Bot Configuration
DISCORD_TOKEN=your_discord_bot_token_here
# Algolia Configuration
ALGOLIA_APP_ID=your_algolia_app_id_here
ALGOLIA_API_KEY=your_algolia_api_key_here
ALGOLIA_MOVIES_INDEX=paradiso_movies
ALGOLIA_VOTES_INDEX=paradiso_votes
Start the bot with:
python paradiso_bot.pyRun the tests with:
python run_tests.pyOr using pytest directly:
pytest test/-
Create a systemd service file:
sudo nano /etc/systemd/system/paradiso-bot.service
-
Add the following content:
[Unit] Description=Paradiso Discord Bot After=network.target [Service] User=your_username Group=your_group WorkingDirectory=/path/to/bot ExecStart=/path/to/python /path/to/bot/paradiso_bot.py Restart=on-failure RestartSec=5 Environment=PYTHONUNBUFFERED=1 [Install] WantedBy=multi-user.target -
Reload systemd, enable and start the service:
sudo systemctl daemon-reload sudo systemctl enable paradiso-bot sudo systemctl start paradiso-bot -
Check the status:
sudo systemctl status paradiso-bot
/add [title]- Add a movie to the voting queue/vote [title]- Vote for a movie/movies- List all movies in the voting queue/search [query]- Search for movies by title, actor, director, etc./related [query]- Find movies related to a specific movie/top [count]- Show the top voted movies (default: top 5)/help- Show help for all commands
paradiso_bot.py- Main bot scripttest/- Unit teststest_bot.py- Basic bot teststest_commands.py- Command teststest_algolia.py- Algolia integration tests
requirements.txt- Dependencies
The project follows a Test-Driven Development (TDD) approach. Tests are written for all key functionality.
To run the tests with coverage report:
pytest --cov=paradiso_bot test/- Discord commands not appearing: Try running
/helpor restart the bot to force sync commands - Algolia errors: Check your API keys and indices names in the
.envfile - Import errors: Make sure all dependencies are installed correctly
This project is licensed under the MIT License - see the LICENSE file for details.