Skip to content

Fabric Discord Community Setup

Overview

Discord server for the Fabric AI coding assistant community, providing support, announcements, and community engagement.

  • Server Name: Fabric
  • Invite Link: https://discord.gg/GqG4Ce97
  • Docs Source: https://farpoint.gitbook.io/fabric/

Bot Configuration

Fabric Bot

  • Application ID: 1461089800843956255
  • Bot Username: Fabric Bot#5998
  • Token Location: Stored in:
  • Local: /Users/ryanmonsurate/Projects/codewithfabric/.env.local as DISCORD_BOT_TOKEN
  • Launchd: /Users/ryanmonsurate/Library/LaunchAgents/com.fabric.discord-daemon.plist

Required Bot Permissions

  • Manage Channels
  • Manage Roles
  • View Channels
  • Send Messages
  • Send Messages in Threads
  • Create Public Threads
  • Read Message History
  • Add Reactions

Required Intents (Developer Portal)

  • [x] MESSAGE CONTENT INTENT (Privileged - must enable manually)
  • [x] GUILDS
  • [x] GUILD_MESSAGES
  • [x] GUILD_MESSAGE_REACTIONS

Channel Structure

📢 INFO
├── #announcements (read-only)
├── #changelog (read-only)
└── #rules (read-only)

💬 COMMUNITY
├── #general
├── #introductions
└── #showcase

🛠️ SUPPORT
├── #help (FAQ bot monitors this)
├── #troubleshooting
└── #faq

💡 FEEDBACK
├── #feature-requests
└── #bug-reports

🧑‍💻 DEVELOPERS
├── #tips-and-tricks
└── #integrations

Support Bot Daemon

Location

/Users/ryanmonsurate/Projects/assistant/discord-daemon/
├── server.mjs           # Main event listener
├── claude-runner.mjs    # Pipes questions to Claude CLI
├── discord-client.mjs   # Discord.js wrapper
├── fetch-gitbook-docs.mjs  # Fetches docs from GitBook
├── docs-cache/          # Cached documentation
├── sessions/            # Thread session tracking
└── start-daemon.sh      # Manual start script

How It Works

  1. Listens for messages in #help channel
  2. Creates a thread for each question
  3. Loads Fabric docs from GitBook cache
  4. Pipes question + docs to Claude CLI
  5. Posts response in thread
  6. Reacts with ✅ when done

Running the Daemon

Via launchd (recommended - auto-starts on login):

# Start
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.fabric.discord-daemon.plist

# Stop
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.fabric.discord-daemon.plist

# View logs
tail -f ~/Projects/assistant/discord-daemon/daemon.log

Manual:

cd ~/Projects/assistant/discord-daemon
DISCORD_BOT_TOKEN="your-token" node server.mjs

Health Check

curl http://localhost:3850/health

Updating Documentation

The bot uses cached GitBook docs. To refresh:

cd ~/Projects/assistant/discord-daemon
node fetch-gitbook-docs.mjs

Security Notes

  • Bot token is stored in .env.local (gitignored)
  • Bot only has access to public docs, NOT the Fabric codebase
  • Rate limiting: 30-second cooldown per user, max 3 concurrent queries
  • All questions/responses logged to daemon.log

Website Integration

Discord link added to navigation header in: - src/components/marketing/navigation.tsx


Management Commands

Regenerate Bot Token (if compromised)

  1. Go to https://discord.com/developers/applications/1461089800843956255/bot
  2. Click "Reset Token"
  3. Update token in:
  4. .env.local
  5. Launchd plist: ~/Library/LaunchAgents/com.fabric.discord-daemon.plist
  6. Restart daemon

Create New Channels (programmatically)

cd ~/Projects/codewithfabric
npx tsx scripts/setup-discord-channels.ts

Future Improvements

See docs/discord-improvements.md for proposed enhancements based on best practices research.