A Discord bot that uses AI (Google Gemini 1.5 Flash) to analyze receipt images, extract items and prices (handling discounts automatically), and generate expense pie charts.
- Python 3.10+ installed on your system.
- A Discord Bot Token (from the Discord Developer Portal).
- A Google Gemini API Key (free from Google AI Studio).
- Clone or Download this repository.
- Open a terminal in the project folder.
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- Windows:
.\venv\Scripts\activate - Mac/Linux:
source venv/bin/activate
- Windows:
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile - Open
.envand add your keys:DISCORD_TOKEN=your_discord_bot_token_here GEMINI_API_KEY=your_gemini_api_key_here
- Start the bot:
python bot.py
- Slash Command Registration:
- If you don't see the commands immediately, type
!syncin your Discord server to force-register them.
- If you don't see the commands immediately, type
- Type
/analyzein Discord. - Attach a receipt image (JPG/PNG).
- The bot will reply with:
- A list of items and their net prices (discounts subtracted).
- A pie chart showing the top expenses (with quantities aggregated).