Dune Bot is an AI Discord bot that chats, remembers, and generates images/code. Uses Pollinations.ai API, switches models, and saves convos. Default model is gpt-5-nano
.
- Remembers chats and channel notes
- Auto-generates images
- Formats code
- Switches AI models per user
- Logs activity
- Python 3.8-3.11
- Discord Bot Token
- Pollinations.ai API Token (for backend access)
- Internet
- discord.py>=2.0.0
- aiohttp
- aiosqlite
- pillow
- apscheduler
- langdetect
- googletrans==4.0.0-rc1
- aiofiles
- python-dotenv
- cachetools
- Download files, put in one folder.
- Get Discord Bot Token:
- Go to https://discord.com/developers/applications
- Click "New Application" (top right)
- Enter a name (e.g., "UnityBot"), click "Create"
- Click "Bot" in left menu
- Click "Add Bot" (under Bot section)
- Click "Reset Token" (under Token), confirm, copy token
- Open .env, add: DISCORD_TOKEN=your_token_here
- Get Pollinations.ai API Token:
- Go to https://auth.pollinations.ai/
- Sign in (likely with Google or email; first login auto-assigns Seed tier)
- Click "[Re]Generate Token"
- Copy the token (e.g., RG4FePiPdUWkk5CI)
- Open .env, add: POLLINATIONS_TOKEN=your_token_here
- Warnings: Never share token publicly, don't commit to Git
- Optional: Restrict bot to specific channels:
- Open .env, add: ALLOWED_CHANNELS=12345,67890 (separate multiple IDs with commas or spaces)
- Leave blank or omit to allow the bot in all channels
- Install dependencies:
- Open terminal/command prompt in folder
- Run: pip install -U pip (updates pip if needed)
- Run: pip install -r requirements.txt
- Run: python -m spacy download en_core_web_sm
- Run bot:
- Double-click RUN_BOT.bat (Windows) or run: python bot.py
- !bothelp - Show commands/models
- !setmodel - Pick AI model (DM)
- !savememory - Save channel note
- !search - Search Dune database
- !item - Lookup item info
- !skill - Lookup skill info
- !contract - Lookup contract info
- !npc - Lookup NPC info
- !wipe - Clear chat history
- "Write a Python function"
- "Generate an image of a forest"
- "Remember I like tea" (then !savememory)
- MEMORY: Last 20 messages/user/model, 5 channel notes, saved in chat_data.json
- IMAGES: Detects "image"/"draw", uses Pollinations.ai
- MODELS: User-picked, defaults to "gpt-5-nano"
- TEXT: <2000 chars = message, 2000-4096 chars = embed, >4096 chars = .txt file
- bot.py - Main bot
- api_client.py - API calls
- message_handler.py - Message handling
- memory_manager.py - Memory
- commands.py - Commands
- config.py - Settings (loads tokens from .env)
- data_manager.py - Data save
- requirements.txt - Dependencies
- .env - Tokens (keep secret)
- system_instructions.txt - AI rules
- info_request_instructions.txt - info-query rules
- RUN_BOT.bat - Start script
- logs/ - application.log, chat_data.json
Game data lives in the information/
directory. Each JSON file covers a domain:
items.json
– full item list and detailsweapons.json
,armor.json
,vehicles.json
,buildings.json
skills.json
,research.json
tips.json
,strategies.json
,gameplay.json
,volumes.json
When a message arrives the bot first asks the LLM which domains it needs (using info_request_instructions.txt
), then reads only the named JSON files and sends the relevant entries back with the user's text to craft a final answer. Add or update data by editing the corresponding file or dropping a new *.json
into information/
.
- Won’t start? Check .env tokens, Python version, reinstall dependencies
- No DMs? Enable "Allow DMs from server members" in Discord
- Slow? Check logs/application.log, restart
- No images/text? Verify tokens in .env, use "generate an image of..."
- Edit config.py: max_history (20), max_memories (5), add code/image keywords
- Edit system_instructions.txt for AI style
- Edit info_request_instructions.txt for data lookup behavior
- Don’t share tokens or .env
- Chats saved in chat_data.json
- Only Pollinations.ai gets requests
- Remembers your style
- Saves channel vibes
- Adds images/code
- Adapts to users
- Fits any server
Check logs or restart if stuck. More chats = better results!
(makes fun images)
(can joke with you)
(will give detail requirment lists for just about anything in game)
ANY SO MuCH MORE!