{"_id":"@anura-gate/watcher-discord-bot","_rev":"2-e90afdd4dac74dd9dda96db7f3a9c264","name":"@anura-gate/watcher-discord-bot","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@anura-gate/watcher-discord-bot","version":"0.1.0","keywords":["gate","watcher","discord","bot","self-hosted"],"license":"MIT","_id":"@anura-gate/watcher-discord-bot@0.1.0","maintainers":[{"name":"anuragate","email":"ahmadajmal1514@gmail.com"}],"bin":{"gate-watcher-discord-bot":"cli.js"},"dist":{"shasum":"c12fc3fc2db41f2cafced6158758cdb2715836d0","tarball":"https://registry.npmjs.org/@anura-gate/watcher-discord-bot/-/watcher-discord-bot-0.1.0.tgz","fileCount":7,"integrity":"sha512-KseW1DiMVpZDDw4H4+c+5SRLr9BPuYxaE3i8Bvcw3oZXsE4lS4LODyA3JBuFxDElSVwzMtvDyZBzukuBDuMMKg==","signatures":[{"sig":"MEYCIQCN8J6aNQ5ug64RTlfB18AGy091W5j98OYChIC2T8BneQIhANJ/KHD1xJwn8UUj15HaIwvEdR+f/QIrJSiDViPGsUmP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":55612},"main":"index.js","engines":{"node":">=18"},"gitHead":"ceacda0ff3fffa5ad840fbc770ab62ef7cb89194","scripts":{"dev":"node cli.js","start":"node cli.js"},"_npmUser":{"name":"anuragate","email":"ahmadajmal1514@gmail.com"},"_npmVersion":"10.9.2","description":"GATE Watcher — Self-hosted daemon for Discord Bot integration. Bot token never leaves your machine.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"dotenv":"^17.3.1","qrcode":"^1.5.4","discord.js":"^14.16.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/watcher-discord-bot_0.1.0_1771499623513_0.3133672420695168","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@anura-gate/watcher-discord-bot","version":"0.2.0","description":"GATE Watcher — Self-hosted daemon for Discord Bot integration. Bot token never leaves your machine.","main":"index.js","bin":{"gate-watcher-discord-bot":"cli.js"},"scripts":{"start":"node cli.js","dev":"node cli.js"},"keywords":["gate","watcher","discord","bot","self-hosted"],"license":"MIT","homepage":"https://anuragate.com","repository":{"type":"git","url":"git+https://github.com/ahmad-ajmal/AnuraGate_Sample.git"},"dependencies":{"discord.js":"^14.16.3","dotenv":"^17.3.1","qrcode":"^1.5.4"},"engines":{"node":">=18"},"_id":"@anura-gate/watcher-discord-bot@0.2.0","gitHead":"0ebb362ebdf75c602ccbaa15cb7db91b80f2901d","bugs":{"url":"https://github.com/ahmad-ajmal/AnuraGate_Sample/issues"},"_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-As1Dzmg18KZzAfAdjPXFSbJVL/WE9VkB7CdRU/9dOCMNFZhbinnWXd5q46SqGq2pHMEuGBkF1b1YMrf4W2ttCw==","shasum":"9830a561d4e90809a8ab10657e91b2cb85f21b53","tarball":"https://registry.npmjs.org/@anura-gate/watcher-discord-bot/-/watcher-discord-bot-0.2.0.tgz","fileCount":8,"unpackedSize":60507,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC3VLu7I4R6iF5GiJBpQt0TqrrT84/xdiO3kAsdniKXowIgUJhLvUbR5RJpHyGxN0F1xfVhExPNc7VWRO8d+9mVYyc="}]},"_npmUser":{"name":"anuragate","email":"ahmadajmal1514@gmail.com"},"directories":{},"maintainers":[{"name":"anuragate","email":"ahmadajmal1514@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/watcher-discord-bot_0.2.0_1772353019552_0.27363124730034105"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-19T11:13:43.378Z","modified":"2026-03-01T08:16:59.868Z","0.1.0":"2026-02-19T11:13:43.652Z","0.2.0":"2026-03-01T08:16:59.715Z"},"license":"MIT","keywords":["gate","watcher","discord","bot","self-hosted"],"description":"GATE Watcher — Self-hosted daemon for Discord Bot integration. Bot token never leaves your machine.","maintainers":[{"name":"anuragate","email":"ahmadajmal1514@gmail.com"}],"readme":"# GATE Watcher — Discord Bot\n\nSelf-hosted daemon that connects your Discord Bot to GATE cloud for security processing. **Your bot token never leaves your machine.**\n\n## How it works\n\n```\nYour Machine (Watcher)              GATE Cloud\n┌─────────────────────┐        ┌──────────────────┐\n│ Discord Bot session  │───────>│ Security pipeline │\n│ (token stays HERE)   │<───────│ (redact, policy,  │\n│                      │ poll   │  audit, forward)  │\n└─────────────────────┘        └──────────────────┘\n```\n\n## Quick Start (CLI)\n\n```bash\ncd gate-watcher-discord-bot\nnpm install\n\n# Create .env (or pass env vars directly)\ncp .env.example .env\n# Fill in GATE_KEY, GATE_INTEGRATION_ID, DISCORD_BOT_TOKEN\n\nnpm start\n```\n\n## Embed in Your App (SDK)\n\n```bash\nnpm install @anura-gate/watcher-discord-bot\n```\n\n```js\nconst { GateDiscordBotWatcher } = require(\"@anura-gate/watcher-discord-bot\");\n\nconst watcher = new GateDiscordBotWatcher({\n  gateKey: \"gk-xxx\",\n  integrationId: \"int_xxx\",\n  botToken: \"your-bot-token\",\n});\n\nwatcher.on(\"ready\", (username, guildCount) => {\n  console.log(`Discord Bot connected: ${username} in ${guildCount} servers`);\n});\n\n// Every message after GATE security processing\nwatcher.on(\"message\", (message, result) => {\n  console.log(`From: ${message.author.tag}, Text: ${message.content}`);\n  console.log(`Security actions: ${result.securityActions}`);\n  console.log(`Blocked: ${result.blocked}`);\n});\n\nwatcher.on(\"member_add\", (member) => {\n  console.log(`New member: ${member.user.tag} joined ${member.guild.name}`);\n});\n\nwatcher.on(\"action_result\", ({ action, success, error }) => {\n  console.log(`${action}: ${success ? \"done\" : error}`);\n});\n\nawait watcher.start();\n\n// Later...\nawait watcher.stop();\n```\n\n## SDK Events\n\n| Event | Args | Description |\n|---|---|---|\n| `ready` | `(username, guildCount)` | Bot connected to Discord |\n| `message` | `(message, result)` | Message received and processed by GATE |\n| `member_add` | `(member)` | Member joined a guild |\n| `member_remove` | `(member)` | Member left a guild |\n| `interaction` | `(interaction)` | Slash command or component interaction |\n| `action` | `(action)` | Outbound action received from GATE queue |\n| `action_result` | `({ actionId, action, success, result, error })` | Outbound action completed |\n| `gate_error` | `({ path, status, error })` | GATE API call failed |\n| `limit_reached` | `(type)` | Plan limit hit |\n| `stopped` | — | Watcher fully shut down |\n\n## SDK Options\n\n| Option | Required | Default | Description |\n|---|---|---|---|\n| `gateKey` | Yes | — | Virtual key (`gk-xxx`) |\n| `integrationId` | Yes | — | Integration ID (`int_xxx`) |\n| `botToken` | Yes | — | Discord bot token |\n| `gateUrl` | No | `\"https://anuragate.com\"` | GATE cloud URL |\n| `intents` | No | `[\"Guilds\", \"GuildMessages\", \"MessageContent\", \"GuildMembers\", \"DirectMessages\"]` | Gateway intents |\n| `heartbeatInterval` | No | `30000` | ms between heartbeats |\n| `pollInterval` | No | `3000` | ms between outbound polls |\n| `sessionId` | No | — | Session ID for multi-tenant use |\n| `sessionLabel` | No | — | Human-readable session label |\n| `sessionMetadata` | No | `{}` | Arbitrary metadata for the session |\n\n### Advanced: Access discord.js directly\n\n```js\nconst client = watcher.getDiscordClient();\nconst guild = await client.guilds.fetch(\"guild-id\");\n```\n\n## Setup\n\n1. Go to [discord.com/developers/applications](https://discord.com/developers/applications) and create a new application\n2. Under **Bot**, click **Add Bot** and copy the **Bot Token**\n3. Under **Bot → Privileged Gateway Intents**, enable **Message Content Intent** and **Server Members Intent**\n4. Under **OAuth2 → URL Generator**, select `bot` scope and the permissions your bot needs, then invite it to your server\n5. Go to **GATE Dashboard → Integrations → Add Integration**, select **Discord Bot**, copy the **Integration ID**\n6. Copy your **Virtual Key** from the **Keys** page\n\n## Environment Variables\n\n| Variable | Required | Description |\n|---|---|---|\n| `GATE_KEY` | Yes | Your GATE virtual key |\n| `GATE_INTEGRATION_ID` | Yes | Integration ID from the dashboard |\n| `DISCORD_BOT_TOKEN` | Yes | Discord bot token |\n| `GATE_URL` | No | Custom GATE cloud URL |\n| `WEB_PORT` | No | Port for the dev dashboard (CLI only) |\n\n## Security model\n\n- Discord bot token stored in `.env` on YOUR machine\n- GATE cloud never sees or stores your credentials\n- All message content passes through GATE's security pipeline\n- Billing, limits, and security enforced server-side\n","readmeFilename":"README.md","homepage":"https://anuragate.com","repository":{"type":"git","url":"git+https://github.com/ahmad-ajmal/AnuraGate_Sample.git"},"bugs":{"url":"https://github.com/ahmad-ajmal/AnuraGate_Sample/issues"}}