No description
  • Python 99.6%
  • Batchfile 0.4%
Find a file
2025-08-26 00:43:20 -07:00
dune_logic Added code for dune logic 2025-08-24 23:38:15 -07:00
information Update volumes.json 2025-08-26 00:36:30 -06:00
api_client.py Update api_client.py 2025-08-24 04:49:45 -06:00
bot.py Add Dune Awakening lookup commands 2025-08-24 23:54:36 -07:00
commands.py Handle image URLs for Pollinations 2025-08-26 01:29:02 -06:00
config.py Add dedicated info request instructions 2025-08-25 01:51:28 -07:00
data_manager.py Update data_manager.py 2025-08-24 04:51:46 -06:00
info_request_instructions.txt Update info_request_instructions.txt 2025-08-25 22:55:46 -06:00
memory_manager.py Update memory_manager.py 2025-08-24 04:52:16 -06:00
message_handler.py Handle image URLs for Pollinations 2025-08-26 01:29:02 -06:00
README.md Add cachetools dependency 2025-08-25 05:11:46 -06:00
requirements.txt Add cachetools dependency 2025-08-25 05:11:46 -06:00
RUN_BOT.bat Update RUN_BOT.bat 2025-08-24 04:49:04 -06:00
system_instructions.txt Update system_instructions.txt 2025-08-24 04:53:53 -06:00

WHAT IS DUNE BOT?

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.

KEY FEATURES

  • Remembers chats and channel notes
  • Auto-generates images
  • Formats code
  • Switches AI models per user
  • Logs activity

REQUIREMENTS

  • Python 3.8-3.11
  • Discord Bot Token
  • Pollinations.ai API Token (for backend access)
  • Internet

DEPENDENCIES

  • discord.py>=2.0.0
  • aiohttp
  • aiosqlite
  • pillow
  • apscheduler
  • langdetect
  • googletrans==4.0.0-rc1
  • aiofiles
  • python-dotenv
  • cachetools

SETUP

  1. Download files, put in one folder.
  2. 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
  3. 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
  4. 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
  5. 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
  6. Run bot:
    • Double-click RUN_BOT.bat (Windows) or run: python bot.py

COMMANDS

  • !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

NATURAL CHAT

  • "Write a Python function"
  • "Generate an image of a forest"
  • "Remember I like tea" (then !savememory)

HOW IT WORKS

  • 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

FILES

  • 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

DATA FILES

Game data lives in the information/ directory. Each JSON file covers a domain:

  • items.json full item list and details
  • weapons.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/.

TROUBLESHOOTING

  • Wont 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..."

CONFIG TWEAKS

  • 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

SECURITY

  • Dont share tokens or .env
  • Chats saved in chat_data.json
  • Only Pollinations.ai gets requests

WHY UNITY?

  • 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) image (can joke with you) image (will give detail requirment lists for just about anything in game) image ANY SO MuCH MORE!