Hooter the Tutor is a Discord bot designed to promote accountability and track study streaks for users in a Discord server. It encourages consistent study habits by monitoring user activity in a dedicated study voice channel.
The application is organized into several key directories and files:
bot/
: Contains core bot functionality
commands.py
: Defines bot commandscore.py
: Core bot setup and configurationevents.py
: Handles Discord eventstasks.py
: Defines scheduled taskscogs/
: Contains modular extensions for the bot
leetcode.py
: LeetCode-related functionalitystreaks.py
: Streak tracking functionalitymodels/
: Contains different AI model integrations
octoAI.py
: OctoAI model integrationopenAI.py
: OpenAI model integrationscripts/
: Contains utility scripts
build_and_run.sh
: Script for building and running the botinstall_dependencies.sh
: Script for installing dependenciesmain.py
: The entry point of the applicationchoose_model.py
: Handles model selectionresponses.py
: Defines bot responsesDockerfile
: For containerizing the applicationrequirements.txt
: Lists Python dependenciesThis structure allows for modular development and easy expansion of the bot's functionality.
./scripts/install_dependencies.sh
script to install requirements and setup a virtual environment (.venv
).venv
.env
file in the project root and add your Discord bot token:
DISCORD_TOKEN=your_discord_bot_token_here
OPENAI_API_KEY=your_openAI_key_here
OCTOAI_API_TOKEN=your_octoAI_key_here
main.py
:
STUDY_CHANNEL_ID = your_study_channel_id
GENERAL_CHANNEL_ID = your_general_channel_id
client = your_chosen_model
python main.py
This project uses pytest for unit testing. To run the unit tests, follow these steps:
./scripts/install_dependencies.sh
script which will install testing requirements from requirements/dev.text
:
pip install pytest pytest-asyncio
pytest tests/unit
This command will discover and run all test files in the tests/unit
directory.
pytest tests/unit/test_leetcode.py
pytest tests/unit/test_leetcode.py::test_leetcode_command_success
-v
flag:
pytest -v tests/unit