Discord Approval Setup (Chronicle Worker)
The project uses Discord Interactions (Buttons) powered by the Chronicle Cloudflare Worker for a stateless, human-in-the-loop approval workflow.
Overview
- Agent creates a
Draftdrop in Chronicle. - Worker sends a message to your Discord channel with the image and buttons:
Approve & Publish: Mints the Zora coin immediately.Edit in Chronicle: Deep-links to the Admin UI for editing.Delete: Marks the draft as deleted.
- Discord sends webhooks to the Worker's
/api/interactionsendpoint when buttons are clicked.
Setup Steps
1. Create a Discord Application
- Go to Discord Developer Portal.
- Create a New Application (e.g., "Chronicle Bot").
- Copy the Application ID (This is your
DISCORD_APP_ID). - Copy the Public Key (This is your
DISCORD_PUBLIC_KEY).
2. Configure Bot
- Go to the Bot tab.
- Click Reset Token to get your Bot Token (This is your
DISCORD_BOT_TOKEN). - Disable "Public Bot" (unless you want others to invite it).
3. Deploy Worker & Set Secrets
Before you can finish the Discord setup, you must deploy your Chronicle Worker so it has a public URL.
-
Set Secrets in Cloudflare:
cd apps/chronicle-worker npx wrangler secret put DISCORD_APP_ID npx wrangler secret put DISCORD_PUBLIC_KEY npx wrangler secret put DISCORD_BOT_TOKEN npx wrangler secret put DISCORD_CHANNEL_IDDISCORD_CHANNEL_ID: Right-click your desired channel in Discord (Developer Mode On) and "Copy ID".
-
Deploy:
Note your worker URL (e.g.,https://chronicle-worker.yourname.workers.dev).
4. Configure Interactions Endpoint
- Back in the Discord Developer Portal.
- Go to General Information.
- Scroll to Interactions Endpoint URL.
- Enter your worker URL appended with
/api/interactions: - Click Save Changes.
- Discord will send a test ping. If your worker is configured correctly (and verified the signature), it will save successfully. If it fails, check your
DISCORD_PUBLIC_KEY.
- Discord will send a test ping. If your worker is configured correctly (and verified the signature), it will save successfully. If it fails, check your
5. Invite Bot
- Go to OAuth2 -> URL Generator.
- Select
botscope. - Select Permissions:
Send Messages,Embed Links,Use External Emojis(optional). - Copy the URL and invite it to your server.