{"id":26637952,"url":"https://github.com/prorobot-ai/nostr-agent","last_synced_at":"2025-03-24T17:07:04.499Z","repository":{"id":279015138,"uuid":"937408047","full_name":"prorobot-ai/nostr-agent","owner":"prorobot-ai","description":"A scalable, extensible bot system built in Go (Golang) for handling direct messages (DMs), group chats, and automated event handling on the Nostr network.","archived":false,"fork":false,"pushed_at":"2025-03-21T07:32:35.000Z","size":122,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T08:28:04.239Z","etag":null,"topics":["bot","bot-framework","go","golang","nostr","nostr-client"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prorobot-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2025-02-23T01:06:41.000Z","updated_at":"2025-03-21T07:32:38.000Z","dependencies_parsed_at":"2025-03-12T00:23:46.262Z","dependency_job_id":"40b2766b-1059-46ca-8b5b-4f6451dcc806","html_url":"https://github.com/prorobot-ai/nostr-agent","commit_stats":null,"previous_names":["prorobot-ai/nostr-agent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prorobot-ai%2Fnostr-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prorobot-ai%2Fnostr-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prorobot-ai%2Fnostr-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prorobot-ai%2Fnostr-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prorobot-ai","download_url":"https://codeload.github.com/prorobot-ai/nostr-agent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245315291,"owners_count":20595217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bot","bot-framework","go","golang","nostr","nostr-client"],"created_at":"2025-03-24T17:07:03.832Z","updated_at":"2025-03-24T17:07:04.487Z","avatar_url":"https://github.com/prorobot-ai.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🤖 NOSTR-AGENT\n\nA scalable, extensible bot system built in **Go (Golang)** for handling direct messages (DMs), group chats, and automated event handling on the **Nostr** network.\n\n### 🌍 Features\n\n- ✅ **Direct Message Bot** (`support_bot`) – Handles user queries and support via encrypted direct messages.\n- ✅ **Group Chat Bot** (`weather_bot`) – Broadcasts weather updates to group channels.\n- ✅ **Welcome Bot** (`welcome_bot`) – Greets new users in group channels.\n- ✅ **Session Manager Bot** (`session`) – Manages multi-bot sessions (Yin and Yang) for interaction.\n- ✅ **Extensible Plugin System** – Supports global and handler-specific plugins (e.g., logging, notifications).\n- ✅ **Dockerized Deployment** – Easily deploy with Docker, including auto-restart capabilities.\n- ✅ **Auto-Resilience** – Automatically restarts if the bot crashes or encounters errors.\n- ✅ **Dynamic Configuration** – Load bot configurations via YAML files.\n\n---\n\n### 🚀 **Getting Started**\n\n#### 📦 **Prerequisites**\n\n- [Go 1.21+](https://golang.org/dl/)\n- [Docker](https://www.docker.com/get-started)\n- [Docker Compose](https://docs.docker.com/compose/)\n\n---\n\n#### 🔑 **Environment Variables**\n\nCreate a `.env` file in the root directory with the following values:\n\n```env\nMETEOMATICS_USERNAME=\nMETEOMATICS_PASSWORD=\n```\n\n---\n\n### ⚙️ **Configuration**\n\nCreate YAML configuration files inside the `configs/` directory.\n\n#### Example: `configs/support_bot.yaml`\n```yaml\nbots:\n  - name: \"Support Bot\"\n    relay_url: \"wss://relay.example.com\"\n    nsec: \"your-secret-key\"\n    channel_id: \"your-channel-id\"\n    listener: \"DMListener\"\n    publisher: \"DMPublisher\"\n    handler: \"SupportHandler\"\n    event_type: \"DMResponseEvent\"\n```\n\n#### Example: `configs/weather_bot.yaml`\n```yaml\nbots:\n  - name: \"Weather Bot\"\n    relay_url: \"wss://relay.example.com\"\n    nsec: \"your-secret-key\"\n    channel_id: \"your-channel-id\"\n    listener: \"GroupListener\"\n    publisher: \"GroupPublisher\"\n    handler: \"GroupHandler\"\n    event_type: \"GroupResponseEvent\"\n```\n\n#### Example: `configs/welcome_bot.yaml`\n```yaml\nbots:\n  - name: \"Welcome Bot\"\n    relay_url: \"wss://relay.example.com\"\n    nsec: \"your-secret-key\"\n    channel_id: \"your-channel-id\"\n    listener: \"DMListener\"\n    publisher: \"GroupPublisher\"\n    handler: \"WelcomeHandler\"\n    event_type: \"GroupResponseEvent\"\n```\n\n#### Example: `configs/session.yaml`\n```yaml\nbots:\n  - name: \"Yin Bot\"\n    relay_url: \"wss://relay.example.com\"\n    nsec: \"your-secret-key\"\n    channel_id: \"your-channel-id\"\n    listener: \"GroupListener\"\n    publisher: \"GroupPublisher\"\n    handler: \"ExchangeHandler\"\n    event_type: \"GroupResponseEvent\"\n\n  - name: \"Yang Bot\"\n    relay_url: \"wss://relay.example.com\"\n    nsec: \"your-secret-key\"\n    channel_id: \"your-channel-id\"\n    listener: \"GroupListener\"\n    publisher: \"GroupPublisher\"\n    handler: \"ExchangeHandler\"\n    event_type: \"GroupResponseEvent\"\n```\n\n---\n\n### 🔨 **Building and Running**\n\n#### ✅ 1. Running Locally (Without Docker)\n\n**Install dependencies**:\n```bash\ngo mod download\n```\n\n**Run the bot**:\n```bash\ngo run main.go --config=configs/support_bot.yaml\n```\n\n#### 🐳 2. Running with Docker\n\n**Step 1**: Build the Docker image:\n```bash\ndocker-compose build\n```\n\n**Step 2**: Start the bot using Docker Compose:\n```bash\ndocker-compose up -d\n```\n\n**Step 3**: View logs:\n```bash\ndocker logs -f support-bot\n```\n\n**Step 4**: Stop the bot:\n```bash\ndocker-compose down\n```\n\n---\n\n### 🔥 **Commands**\n\n| Command                           | Description                          |\n|-----------------------------------|--------------------------------------|\n| `agent --config=configs/support_bot.yaml` | Starts support bot                    |\n| `agent --config=configs/weather_bot.yaml` | Starts weather bot                    |\n| `agent --config=configs/welcome_bot.yaml` | Starts welcome bot                    |\n| `agent --config=configs/session.yaml`    | Starts session with Yin and Yang bots |\n\n**Generate project tree**:\n```bash\ntree --prune -I \"$(paste -sd'|' .treeignore)\" \u003e tree.txt\n```\n\n---\n\n### 🐳 **Docker Compose Configuration Example**\n\n```yaml\nversion: \"3.8\"\n\nservices:\n  support_bot:\n    build:\n      context: .\n      dockerfile: Dockerfile\n    container_name: support-bot\n    restart: unless-stopped\n    env_file:\n      - .env\n    command: [\"--config=configs/support_bot.yaml\"]\n    volumes:\n      - ./logs/support:/app/logs\n\n  weather_bot:\n    build:\n      context: .\n      dockerfile: Dockerfile\n    container_name: weather-bot\n    restart: unless-stopped\n    env_file:\n      - .env\n    command: [\"--config=configs/weather_bot.yaml\"]\n    volumes:\n      - ./logs/weather:/app/logs\n\n  welcome_bot:\n    build:\n      context: .\n      dockerfile: Dockerfile\n    container_name: welcome-bot\n    restart: unless-stopped\n    env_file:\n      - .env\n    command: [\"--config=configs/welcome_bot.yaml\"]\n    volumes:\n      - ./logs/welcome:/app/logs\n```\n\n---\n\n### 🤝 **Contributing**\n\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature/your-feature`).\n3. Commit your changes (`git commit -am 'Add new feature'`).\n4. Push to the branch (`git push origin feature/your-feature`).\n5. Create a new Pull Request.\n\n---\n\n### 📝 **License**\n\nThis project is licensed under the MIT License.\n\n---\n\n### 📫 **Contact**\n\nFor support or collaboration inquiries, reach out to:\n- GitHub Issues\n- Email: prorobot.ai.sales@gmail.com\n\n---\n\n### 🌟 **Acknowledgments**\n\n- Built using **Go**\n- Uses the **Nostr** protocol\n- Dockerized for easy deployment 🚀","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprorobot-ai%2Fnostr-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprorobot-ai%2Fnostr-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprorobot-ai%2Fnostr-agent/lists"}