尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證An open-source Discord bot hosted on Cloudflare and Google Cloud.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗A powerful, self-hosted Discord bot platform built with SvelteKit 2 (Svelte 5) and deployed on Cloudflare Pages. Create custom slash commands, build event-driven automations, and monitor all Discord activity through a beautiful admin dashboard.
/room or a join-to-create lobby; a server preset decides who may make one, what
the creator can do to it, and when it closes itself/timebox start runs focus blocks and breaks (23/5/15 minutes by default),
alone or for everyone in your voice channel, with Pause / Skip / Stop and an optional
"deafen me" you can always lift. Off until a server enables it (see
docs/timebox.md)/quorum ask puts a yes/no question to the server; it closes itself
at the deadline, posts a RESULT naming an owner and a due date, and keeps counts
only, never who voted (see docs/quorum.md)AI_PROVIDER=ollama, default gemma3:4b)./servers where admins can publish
their community (off by default; see Server Browser)cron_expression values stored in D1 (see
docs/superadmin-workflows.md).mcp-server/) that
exposes SpaceBot data/operations to MCP-aware clients.SESSION_TTL_SECONDSRepository-ready external integrations are configured with environment variables, not hardcoded credentials:
PUBLIC_SUPPORT_DISCORD_URL, PUBLIC_BOT_VOTE_URL, and PUBLIC_BOT_REVIEW_URL power public community CTAs.SENTRY_DSN, SENTRY_ENVIRONMENT, and SENTRY_TRACES_SAMPLE_RATE enable Sentry.RATE_LIMIT_ENABLED, RATE_LIMIT_DEFAULT_WINDOW_SECONDS, and RATE_LIMIT_DEFAULT_MAX_REQUESTS enable D1-backed API limits.Useful checks:
bun run docs:api
bun run audit:deps
bun run images:check
bun run verify:http3
Secure Discord OAuth2 authentication for accessing the admin dashboard.
View event logs, statistics, and quick access to automations and commands.
The dashboard also supports a clean light theme.
Create event-driven automations that trigger on Discord events like member joins, message creates, voice state changes, and more.
Visual interface for configuring triggers, conditions, and actions for your automations.
Build custom slash commands with parameters and tie them to automation actions.
Design slash commands with options, parameters, and custom responses through an intuitive editor.
Comprehensive logging of all Discord events with filtering and search.
| Layer | Technology |
|---|---|
| Framework | SvelteKit 2 (Svelte 5) |
| Edge runtime | Cloudflare Pages/Workers |
| Package manager | Bun |
| Database | Cloudflare D1 (SQLite) |
| Bot Library | Discord.js 14 |
| AI | Cloudflare Workers AI / AI Gateway (prod); Ollama (dev only) |
| Styling | Custom CSS with CSS Variables |
| Auth | Discord OAuth2 |
Clone the repository
git clone https://github.com/starspacegroup/spacebot.git
cd spacebot
Install dependencies
bun install
Configure environment variables
Copy .env.example to .env and fill in your Discord credentials:
cp .env.example .env
Required variables:
| Variable | Description |
|---|---|
DISCORD_PUBLIC_KEY | Found in your app's "General Information" |
DISCORD_CLIENT_ID | Your application's Client ID |
DISCORD_CLIENT_SECRET | Found under OAuth2 settings |
DISCORD_BOT_TOKEN | Found under "Bot" settings |
ADMIN_USER_IDS | Comma-separated Discord user IDs with global admin access |
LOG_LEVEL | Logging verbosity: error, warn, info, debug |
Optional AI variables (for DM chat functionality):
| Variable | Description |
|---|---|
CLOUDFLARE_ACCOUNT_ID | Your Cloudflare account ID |
CLOUDFLARE_AI_TOKEN | API token with Workers AI permissions |
CLOUDFLARE_AI_GATEWAY_ID | (Optional) AI Gateway ID for analytics/caching |
CLOUDFLARE_AI_MODEL | (Optional) Override default LLM model |
Set up the database (local development)
bun run db:migrate:local
Run the development server
bun run dev
The app will be available at http://localhost:4269 (the port is pinned in
vite.config.js).
Start the Gateway bot (in a separate terminal)
bot, applications.commandsFor production, configure Discord to send interactions to your Cloudflare Pages URL:
https://your-domain.pages.dev/api/discord/interactions
| Script | Description |
|---|---|
bun run dev | Start SvelteKit dev server |
bun run dev:wrangler | Run with Wrangler (Cloudflare local environment) |
bun run dev:gateway | Start Discord gateway bot |
bun run dev:tunnel | Start cloudflared tunnel for local development |
bun run build | Build for production |
bun run db:migrate | Run database migrations (production) |
bun run db:migrate:local | Run database migrations (local) |
bun run register-commands | Register slash commands with Discord |
bun run test | Run the Vitest test suite |
bun run test:e2e | Run the Playwright smoke suite |
bun run typecheck | Type-check with svelte-check |
bun run lint | Run ESLint |
bun run runner | Start the local runner CLI |
SpaceBot's automation engine lets you create powerful event-driven workflows:
Use dynamic variables in your messages:
Welcome {user.mention} to {guild.name}!
Available: {user.id}, {user.name}, {user.mention}, {channel.name},
{guild.name}, {option.<name>}, and more.
Create custom slash commands through the web dashboard:
SpaceBot captures and logs all Discord events:
| Category | Events |
|---|---|
| 👤 Member | Join, leave, update, nickname changes |
| 💬 Message | Create, edit, delete, bulk delete |
| 🎤 Voice | Join, leave, mute, deafen, stream, video |
| 📁 Channel | Create, delete, update |
| 🏷️ Role | Create, delete, update, member assignments |
| 🔨 Moderation | Ban, unban, kick, timeout |
| ⚡ Interaction | Commands, buttons, modals, select menus |
| 📅 Events | Scheduled event create, update, delete |
Push to GitHub
git push origin main
Connect to Cloudflare Pages
bun run build.svelte-kit/cloudflareAdd Environment Variables In Cloudflare Pages Settings → Environment Variables, add all required variables.
Create D1 Database
wrangler d1 create spacebot-logs
Update wrangler.toml with the database ID.
Run Migrations
bun run db:migrate
Deploy Future pushes to main will auto-deploy.
AI queue orchestration also auto-deploys via GitHub Actions in .github/workflows/deploy-orchestrator-worker.yml.
Configure these repository secrets so worker deploys can run:
CLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_IDORCHESTRATOR_SPACEBOT_API_BASEAI_AUTOPILOT_INTERNAL_KEYSee DEPLOYMENT.md for detailed instructions.
spacebot/
├── src/
│ ├── lib/
│ │ ├── ai/ # AI chat, MCP client, retry policy
│ │ ├── automation/ # Event → action automation engine
│ │ ├── components/ # Svelte components
│ │ ├── db/ # D1/SQLite access, one module per domain
│ │ ├── discord/ # Gateway client, REST, bot registry, commands
│ │ ├── integrations/ # External integrations (e.g. GitHub) + auth
│ │ ├── server/ # Server-only helpers (cron, workflow runtime)
│ │ └── utils/ # Shared utilities
│ ├── routes/
│ │ ├── admin/ # Per-server dashboard (under [serverId]/)
│ │ ├── account/ # User-level AI jobs / workflows / operations
│ │ └── api/ # REST endpoints (+ api/v1, api/runner/ws)
│ ├── tests/ # Vitest test suites
│ └── hooks.server.ts # Edge auth + request handling
├── orchestrator-worker/ # Cloudflare Queue consumer (AI autopilot, cron)
├── mcp-server/ # Standalone MCP server
├── scripts/ # CLIs and tooling (incl. scripts/local-runner/)
├── migrations/ # D1 database migrations (immutable once applied)
├── _functions/ # Cloudflare Pages Functions
├── static/ # Static assets
└── docs/ # Documentation (incl. architecture.md, screenshots/)
See docs/architecture.md for a diagram of how the runtimes fit together, and CLAUDE.md for the authoritative architecture notes.
Developer documentation is served on the main site at
https://spacebot.starspace.group/docs/dev — rendered at build time from
docs/, so there's no separate docs host to maintain.
Highlights: Architecture · API · Integrations · AI Autopilot · Local Runner v2 · Superadmin Workflows · Server Browser · Observability · Tutorials.
See ROADMAP.md for planned features and enhancements.
See CONTRIBUTING.md for local setup, the project's hard rules (immutable migrations, Bun-only, the multi-runtime model), and how to run tests before opening a PR.
MIT
bun run dev:gateway
This captures Discord events and processes automations.