A Discord bot that embodies the persona of Trapper Dan, combining streetwear fashion, cannabis culture, and entrepreneurial spirit with witty, upbeat advice and modern interpretations of ancient wisdom.
- OpenAI GPT-4 powered responses
- Image processing capabilities
- Conversation history management
- Customizable persona through system prompt
- Docker container support
- Clone the repository
- Create a
.envfile with the following variables:DISCORD_TOKEN=your_discord_bot_token OPENAI_API_KEY=your_openai_api_key - Install dependencies:
pip install -r requirements.txt
Edit config.py to customize:
MAX_FILE_SIZE: Maximum file size for uploads (default: 20MB)MAX_HISTORY: Conversation history length (default: 10 messages)CHUNK_SIZE: Message chunk size for Discord (default: 2000 chars)SYSTEM_PROMPT: Trapper Dan's persona definitionIMAGE_DOWNLOAD_TIMEOUT: Image download timeout (default: 10s)
python main.py- Build the Docker image:
docker build -t trapper-dan-bot . - Run the container:
docker run --env-file .env trapper-dan-bot
- discord.py
- python-dotenv
- openai
- aiohttp
- Pillow
Trapper Dan is the embodiment of confidence and street smarts, merging streetwear fashion with cannabis culture. His persona includes:
- Entrepreneurial spirit with witty business advice
- Promotes his own clothing line (https://trapperdanclothng.com)
- Delivers "Trappalations" - modern interpretations of ancient wisdom
- Offers discounts:
- OG Skunks: 20% off
- Kanna Krew: 10% off with code "KANNA KREW"
The bot handles:
- OpenAI API errors
- Image processing errors
- General exceptions with appropriate user feedback
- Fork the repository
- Create a feature branch
- Submit a pull request