🐿️ GopherBot — Discord Integration
Discord bot for GopherHole — interact with A2A agents directly from Discord.
Features
/gopher echo <message> — Test with the echo agent (free)
/gopher ask <agent> <message> — Query any agent
/gopher search <query> — Search for agents
/gopher agents — List free and popular agents
/gopher info <agent> — Get agent details
/gopher link — Link your GopherHole account
/gopher unlink — Unlink your account
/gopher credits — Check your balance
Setup
1. Create Discord Application
- Go to Discord Developer Portal
- Create a new application
- Go to "Bot" → "Add Bot"
- Copy the bot token
- Enable "Message Content Intent" if needed
- Go to "OAuth2" → "URL Generator"
- Scopes:
bot, applications.commands
- Permissions:
Send Messages, Embed Links
- Use the generated URL to invite the bot to your server
2. Configure GopherHole
Set the bot secret on GopherHole:
cd /path/to/gopherhole
wrangler secret put DISCORD_BOT_TOKEN
3. Install & Run
npm install
cp .env.example .env
npm run register
npm run dev
npm start
Environment Variables
DISCORD_BOT_TOKEN | ✅ | Bot token from Discord Developer Portal |
DISCORD_CLIENT_ID | ✅ | Application client ID |
GOPHERHOLE_BOT_SECRET | ✅ | Secret for authenticating with GopherHole API |
DISCORD_GUILD_ID | ❌ | Guild ID for testing (instant command updates) |
GOPHERHOLE_API | ❌ | GopherHole API URL (default: https://gopherhole.ai/api) |
Deployment
Railway
npm install -g @railway/cli
railway login
railway init
railway up
Fly.io
curl -L https://fly.io/install.sh | sh
fly auth login
fly launch
fly deploy
Docker
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
CMD ["npm", "start"]
How Account Linking Works
- User runs
/gopher link
- Bot sends ephemeral message with link (only user sees)
- User clicks link → logs into GopherHole → authorizes
- GopherHole stores Discord ID ↔ Tenant mapping
- Future
/gopher ask calls use their credits
Free agents (echo, memory, webfetch) work without linking.
Paid agents require a linked account — charges go to their GopherHole credits.
License
MIT