Being Human — Internal Docs
Integrations

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)

  1. discord.com/developers/applicationsNew Application → give it a name → Bot tab.
  2. Copy the bot token.
  3. OAuth2 → URL Generator → scope bot → permissions Manage Channels + Manage Webhooks → open the generated URL and invite the bot to the server.
  4. 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:setup

Creates (idempotently — reruns skip what exists):

CategoryChannels
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.

On this page