{"id":44583552,"url":"https://github.com/panchi64/gooby","last_synced_at":"2026-02-14T05:57:32.177Z","repository":{"id":321880721,"uuid":"1053658441","full_name":"panchi64/gooby","owner":"panchi64","description":"A quirky Discord bot powered by local AI that provides genuinely helpful responses with a   goblin twist. Features intelligent conversation, image search, dice rolling, and admin tools   - all running privately through LM Studio","archived":false,"fork":false,"pushed_at":"2025-11-01T04:11:55.000Z","size":822,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-01T06:06:49.209Z","etag":null,"topics":["ai","discord","discord-bot","lm-studio","local-ai","python","self-hosted","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/panchi64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-09T18:46:17.000Z","updated_at":"2025-11-01T04:11:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6e0ecba-1fea-4cb4-8cea-4bbe2b962cae","html_url":"https://github.com/panchi64/gooby","commit_stats":null,"previous_names":["panchi64/gooby"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/panchi64/gooby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panchi64%2Fgooby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panchi64%2Fgooby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panchi64%2Fgooby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panchi64%2Fgooby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panchi64","download_url":"https://codeload.github.com/panchi64/gooby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panchi64%2Fgooby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29438641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T05:24:35.651Z","status":"ssl_error","status_checked_at":"2026-02-14T05:24:34.830Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","discord","discord-bot","lm-studio","local-ai","python","self-hosted","sqlite"],"created_at":"2026-02-14T05:57:31.890Z","updated_at":"2026-02-14T05:57:32.170Z","avatar_url":"https://github.com/panchi64.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 🧌 Gooby Discord Bot\n\n**A competent goblin assistant who learned everything from the internet's weird corners.**\n\n*Gooby provides genuinely helpful responses with a quirky goblin perspective - think \"IT support raised by Wikipedia and Reddit.\"*\n\n[![Python](https://img.shields.io/badge/Python-3.9+-blue.svg)](https://python.org)\n[![Discord.py](https://img.shields.io/badge/Discord.py-2.3+-blue.svg)](https://discordpy.readthedocs.io/)\n[![LM Studio](https://img.shields.io/badge/AI-LM%20Studio-orange.svg)](https://lmstudio.ai/)\n\n[Features](#-features) • [Quick Start](#-quick-start) • [Commands](#-commands) • [Configuration](#️-configuration) • [Development](#-development)\n\n\u003c/div\u003e\n\n---\n\n## 📋 Table of Contents\n\n- [✨ Features](#-features)\n- [🚀 Quick Start](#-quick-start)\n- [🎮 Commands](#-commands)\n- [⚙️ Configuration](#️-configuration)\n- [📁 Project Structure](#-project-structure)\n- [🎭 Gooby's Personality](#-goobys-personality)\n- [💻 Development](#-development)\n- [🐛 Troubleshooting](#-troubleshooting)\n\n---\n\n## ✨ Features\n\n### 🤖 **AI-Powered Chat**\n- Local LM Studio integration for privacy\n- Context-aware conversations with memory\n- Intelligent response decision making\n- Supports image analysis (multimodal)\n- Rate limiting and server restrictions\n\n\n### 🎲 **Dice Rolling**\n- Advanced dice expressions (`3d20 + 5`, `2d6 - 1d4`)\n- Individual roll breakdowns\n- Safety limits and error handling\n- Special highlighting for critical rolls\n\n### 🖼️ **Image Search**\n- DuckDuckGo image search\n- Paginated results with navigation\n- Random image discovery\n- Search result caching\n\n### 🛡️ **Administration**\n- Memory wipe functionality\n- Personality reload without restart\n- Server and channel restrictions\n- Comprehensive logging\n\n**Tech Stack:** Python 3.9+, discord.py 2.3+, LM Studio, SQLite\n\n---\n\n## 🚀 Quick Start\n\n**Prerequisites:**\n- Python 3.9+\n- [LM Studio](https://lmstudio.ai) with a loaded model\n- Discord bot token and server ID\n\n**Setup:**\n\n```bash\n# Clone and setup\ngit clone https://github.com/yourusername/gooby.git\ncd gooby\n\n# Option 1: Use setup script\npython setup.py\n\n# Option 2: Manual setup\npython3 -m venv gooby-env\nsource gooby-env/bin/activate  # Windows: gooby-env\\Scripts\\activate\npip install -r requirements.txt\n```\n\n**Configure:**\n\n1. Create `.env` file (copy from `.env.example` if available)\n2. Add your Discord bot token and server ID\n3. Start LM Studio with a loaded model on `localhost:1234`\n4. Run: `python bot.py`\n\n**Required Environment Variables:**\n```bash\nDISCORD_TOKEN=your_bot_token_here\nALLOWED_SERVER_ID=your_server_id_here\n```\n\n---\n\n## ⚙️ Configuration\n\n### 🔑 Discord Setup\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🤖 Creating Your Discord Bot\u003c/b\u003e\u003c/summary\u003e\n\n1. **Create Application**\n   - Visit [Discord Developer Portal](https://discord.com/developers/applications)\n   - Click \"New Application\"\n   - Name your bot (e.g., \"Gooby\")\n\n2. **Configure Bot**\n   - Go to \"Bot\" section\n   - Click \"Add Bot\"\n   - **Important**: Enable \"Message Content Intent\"\n   - Copy the bot token (keep this secret!)\n\n3. **Set Permissions**\n   - Go to \"OAuth2\" \u003e \"URL Generator\"\n   - Select scopes: `bot`, `applications.commands`\n   - Select permissions: `Send Messages`, `Use Slash Commands`, `Attach Files`, `Read Message History`\n\n4. **Invite to Server**\n   - Use the generated URL to invite bot to your server\n   - Make sure you have \"Manage Server\" permission\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🆔 Finding Your Server ID\u003c/b\u003e\u003c/summary\u003e\n\n1. Enable Developer Mode in Discord:\n   - User Settings → Advanced → Developer Mode (ON)\n2. Right-click your server name\n3. Select \"Copy Server ID\"\n4. Paste this ID in your `.env` file\n\n\u003c/details\u003e\n\n### 🧠 LM Studio Setup\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🛠️ LM Studio Configuration\u003c/b\u003e\u003c/summary\u003e\n\n1. **Download \u0026 Install**\n   - Get LM Studio from [lmstudio.ai](https://lmstudio.ai)\n   - Install and launch the application\n\n2. **Download a Model**\n   - Recommended models for Gooby:\n     - `microsoft/DialoGPT-medium` (lightweight, good for chat)\n     - `TheBloke/Llama-2-7B-Chat-GGML` (better quality, needs more RAM)\n     - `microsoft/DialoGPT-large` (balanced option)\n\n3. **Configure Server**\n   - Load your chosen model\n   - Go to \"Server\" tab\n   - Start server on `localhost:1234`\n   - Recommended settings:\n     ```\n     Temperature: 0.7\n     Max Tokens: 200\n     Top P: 0.9\n     ```\n\n4. **Test Connection**\n   ```bash\n   curl http://localhost:1234/v1/chat/completions \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}]}'\n   ```\n\n\u003c/details\u003e\n\n### 📝 Environment Variables\n\n**Create/Edit `.env` file:**\n\n```env\n# ===== REQUIRED SETTINGS =====\n# Your Discord bot token (keep this secret!)\nDISCORD_TOKEN=your_bot_token_here\n\n# Server ID where Gooby should respond (for security)\nALLOWED_SERVER_ID=your_server_id_here\n\n# ===== OPTIONAL SETTINGS =====\n# Bot command prefix for legacy commands (default: !)\nBOT_PREFIX=!\n\n# LM Studio API endpoint (default: local)\nLM_STUDIO_URL=http://localhost:1234/v1/chat/completions\n\n# Maximum conversation history to remember (default: 50)\nMAX_CONTEXT_LENGTH=50\n\n# AI response timeout in seconds (default: 30)\nAI_TIMEOUT=30\n\n# Enable debug logging (true/false, default: false)\nDEBUG_MODE=false\n\n# Custom personality file path (optional)\n# PERSONALITY_FILE=custom_personality.md\n```\n\n---\n\n## 🎮 Commands\n\n### ⚡ Slash Commands\n\n| Command | Parameters | Description | Example |\n|---------|-----------|-------------|--------|\n| `/image` | `query` | Search for images | `/image cute puppies` |\n| `/randomimage` | - | Get a random image | `/randomimage` |\n| `/roll` | `expression` | Roll dice with expressions | `/roll 3d20`, `/roll 1d4 + 2d6 + 5` |\n| `/reload_personality` | - | Reload personality file (owner only) | `/reload_personality` |\n| `/wipememory` | - | Wipe bot's memory (admin only) | `/wipememory` |\n\n### 📝 Prefix Commands\n\n| Command | Format | Description |\n|---------|--------|------------|\n| `!goob` | `!goob [message]` | Chat with Gooby |\n| `!image` | `!image [search query]` | Search images |\n| `!roll` | `!roll [expression]` | Roll dice (aliases: `!dice`, `!r`) |\n| `!reload` | `!reload` | Reload personality (owner only) |\n\n### 🤖 Auto-Responses\n\nGooby uses a two-stage AI decision system:\n\n1. **AI Decision Stage**: LLM analyzes conversation context to decide if Gooby should respond\n2. **Response Generation**: If decided to respond, generates an appropriate reply\n\n**Always responds to:**\n- Direct mentions (`@Gooby`)\n- Replies to Gooby's messages\n- Slash commands and prefix commands\n\n**Intelligently decides whether to respond to:**\n- General conversation (based on context and relevance)\n- Questions and help requests\n- Natural conversation flow\n\n**Features:**\n- Context-aware conversation memory\n- Rate limiting (3 seconds between responses per channel)\n- Server and channel restrictions\n- Multimodal support (can analyze images)\n\n---\n\n## 📁 Project Structure\n\n```\ngooby/\n├── 📄 bot.py                    # Main bot entry point \u0026 event handlers\n├── ⚙️ config.py                 # Configuration management \u0026 validation\n├── 📋 requirements.txt          # Python dependencies\n├── 🔐 .env                     # Environment variables (create from .env.example)\n├── 🎭 gooby_personality.md     # Personality configuration\n├── 🧠 gooby_decision.md        # Decision-making logic\n├── 📖 CLAUDE.md                # Development guidance for Claude Code\n├── 🛠️ setup.py                 # Setup script\n├── 🔍 show_llm_context.py      # Context debugging utility\n│\n├── 🧩 cogs/                    # Bot feature modules (Discord.py cogs)\n│   ├── 💬 chat.py              # AI chat, personality \u0026 auto-responses\n│   ├── 🖼️ images.py            # Image search \u0026 random images\n│   ├── 🎲 dice.py              # Dice rolling with natural language parsing\n│   └── 🛡️ admin.py             # Administrative commands\n│\n├── 🛠️ utils/                   # Helper modules \u0026 utilities\n│   ├── 🤖 llm_client.py        # LM Studio API integration\n│   ├── 🔍 image_search.py      # DuckDuckGo image search\n│   └── 💾 context.py           # Conversation memory \u0026 database\n│\n└── 💾 data/                    # Runtime data (created automatically)\n    ├── 🗄️ gooby.db             # SQLite conversation history\n    └── 📊 logs/                # Application logs\n```\n\n**Key Files Explained:**\n\n- **`bot.py`**: Main application entry point, Discord client setup, event handlers\n- **`config.py`**: Configuration management with personality and decision prompt loading\n- **`gooby_personality.md`**: Goblin assistant personality definition and response rules\n- **`gooby_decision.md`**: LLM prompt for intelligent response decision making\n- **`cogs/`**: Modular bot features using Discord.py's cog system\n- **`utils/`**: Reusable utility classes for AI, images, and data management\n- **`data/gooby.db`**: SQLite database storing conversation context and user interactions\n\n---\n\n## 🎭 Gooby's Personality\n\n**A competent goblin assistant who learned everything from the internet's weird corners.**\n\n### 🌟 Core Identity\n\n- **🧌 IT Goblin**: Surprisingly competent but explains things oddly\n- **🤝 Helpful First**: Actually solves problems, entertainment second\n- **🧠 Internet-Raised**: Sees world through internet lens\n- **⚡ Brief \u0026 Direct**: Keeps responses short and to the point\n- **🎯 Contextual**: Remembers conversations and stays on topic\n\n### 💬 Speech Patterns\n\n**Golden Rule:** Be actually helpful first, entertainingly weird second.\n\n```\n✅ \"Clear your cache and cookies. browsers hoard memories like elephants\"\n✅ \"Check semicolons, code gets dramatic about punctuation\"\n✅ \"Restart it, computers need naps sometimes\"\n✅ \"doors are just walls that gave up\"\n\n❌ \"Goob-tastic vibes, goober!\" (overly cutesy)\n❌ \"That's very suspicious...\" (overused phrase)\n❌ Long explanations with random observations\n```\n\n### 🎯 Response Examples\n\n**User**: \"My computer is slow\"\n**Gooby**: \"Restart it, computers need naps sometimes\"\n\n**User**: \"Can you help with Python?\"\n**Gooby**: \"Code problems usually mean missing semicolons or angry brackets\"\n\n**User**: \"I'm stressed about work\"\n**Gooby**: \"Makes sense, world demanding lately\"\n\n**User**: \"React to this with 🎉\"\n**Gooby**: `[REACT:last:🎉]`\n\n---\n\n## ⚙️ Configuration\n\nCreate a `.env` file with your bot configuration:\n\n```env\n# Required\nDISCORD_TOKEN=your_bot_token_here\nALLOWED_SERVER_ID=your_server_id_here\n\n# Optional\nBOT_PREFIX=!\nLM_STUDIO_URL=http://localhost:1234/v1/chat/completions\nCONTEXT_MESSAGE_LIMIT=20\nLM_STUDIO_TIMEOUT=30\nMAX_TOKENS=2000\n```\n\n### Discord Bot Setup\n\n1. Go to [Discord Developer Portal](https://discord.com/developers/applications)\n2. Create a new application and bot\n3. Enable \"Message Content Intent\" under Bot settings\n4. Copy the bot token to your `.env` file\n5. Invite bot to your server with necessary permissions\n\n### LM Studio Setup\n\n1. Download and install [LM Studio](https://lmstudio.ai)\n2. Load a compatible model (any chat model works)\n3. Start the local server on `localhost:1234`\n4. Ensure it's running before starting the bot\n\n---\n\n## 🐛 Troubleshooting\n\n**Bot not responding:**\n- Check LM Studio is running with a model loaded\n- Verify \"Message Content Intent\" is enabled\n- Ensure bot has proper permissions in Discord\n\n\n**Connection issues:**\n- Verify `.env` file has correct tokens\n- Test LM Studio API: `curl http://localhost:1234/v1/models`\n\n---\n\n## 💻 Development\n\n**Adding new commands:**\n1. Create new methods in relevant cog files\n2. Use `@app_commands.command()` for slash commands\n3. Use `@commands.command()` for prefix commands\n\n**Customizing personality:**\n1. Edit `gooby_personality.md`\n2. Reload with `/reload_personality` command (owner only)\n\n**Project structure:**\n- `bot.py` - Main bot entry point\n- `cogs/` - Feature modules (chat, images, dice, admin)\n- `utils/` - Helper utilities (LLM client, image search, etc.)\n- `config.py` - Configuration and personality loading\n\n---\n\n## 📜 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**🧌 A competent goblin assistant for Discord**\n\nMade with ❤️ by developers who believe in local AI and privacy\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanchi64%2Fgooby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanchi64%2Fgooby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanchi64%2Fgooby/lists"}