A Discord bot that acts as an interactive bartender, powered by ChatGPT, with a scalable architecture using FastAPI, Kafka, and ngrok.
- Discord bot with slash commands for interacting with a virtual bartender
- AI-powered conversations using ChatGPT
- Scalable message processing with Kafka
- Local development with ngrok for webhook handling
- Modern API layer with FastAPI
- Python 3.8+
- Discord Developer Account
- OpenAI API Key
- ngrok Account
- Kafka (or Docker for local Kafka setup)
- Clone this repository
- Install dependencies:
pip install -r requirements.txt - Create a
.envfile with the following variables:# Discord Configuration DISCORD_BOT_TOKEN=your_discord_bot_token DISCORD_APPLICATION_ID=your_application_id # OpenAI Configuration OPENAI_API_KEY=your_openai_api_key # ngrok Configuration NGROK_AUTH_TOKEN=your_ngrok_auth_token # Kafka Configuration (if using local setup) KAFKA_BOOTSTRAP_SERVERS=localhost:9092 - Run the bot:
python src/main.py
├── docs/ # Documentation
├── src/ # Source code
│ ├── api/ # FastAPI routes and endpoints
│ ├── bot/ # Discord bot implementation
│ ├── kafka/ # Kafka producers and consumers
│ ├── ai/ # ChatGPT integration
│ ├── config.py # Configuration management
│ └── main.py # Application entry point
├── .env # Environment variables (not in repo)
├── requirements.txt # Project dependencies
└── README.md # Project documentation
- Start the FastAPI server
- Connect to Discord via the bot
- Use ngrok to expose the FastAPI server
- Register the ngrok URL with Discord for slash commands
- Start Kafka producers and consumers
MIT