Discord
Server setup CLI and the event feed webhook
Two pieces: a CLI that builds out the Discord server and a webhook feed the API posts events to.
1. Create the bot (once)
- discord.com/developers/applications → New Application → give it a name → Bot tab.
- Copy the bot token.
- OAuth2 → URL Generator → scope
bot→ permissions Manage Channels + Manage Webhooks → open the generated URL and invite the bot to the server. - Enable Developer Mode in your Discord settings, right-click the server icon → Copy Server ID.
2. Build the server
cd apps/api
DISCORD_BOT_TOKEN=... DISCORD_GUILD_ID=... pnpm discord:setupCreates (idempotently — reruns skip what exists):
| Category | Channels |
|---|---|
| info | #welcome #announcements #rules |
| community | #general #screenshots #suggestions |
| dev | #dev-log #wishlist-feed #bug-reports |
| playtest | #playtest-chat #invite-codes |
It also creates a webhook named beinghuman-api on #wishlist-feed and prints the webhook URL — put that in apps/api/.env as DISCORD_WEBHOOK_URL.
The server has already been built and a permanent public invite exists on #welcome:
discord.gg/fKkp8pvvFt. The landing page links to it from the
nav, community section and footer (apps/web/components/links.ts).
Want a different layout? Edit PLAN in apps/api/scripts/discord-setup.ts and rerun.
3. The event feed
With DISCORD_WEBHOOK_URL set, the API announces:
- 🎉 wishlist signups (with source)
- 🤝 invite redemptions
- 🏆 achievement unlocks
Design constraints baked into src/discord.ts:
- Fire-and-forget — a Discord outage can never fail or slow an API response.
- No mention parsing (
allowed_mentions: []) — feed content can't ping people. - Without the env var it logs
[discord] disabled — <message>so you can see what would fire.
Add a new event by calling ctx.discord.notify("...") wherever the fact is committed.
Later
A proper bot (slash commands: /invite, /achievements, playtest-key delivery via DM) would reuse the same bot token — the notifier stays as-is since webhooks are the right tool for one-way announcements.