Always-on Usage

Copy library / Guides / Grok Bot

grokbot-discord: relay Discord slash commands to a Grok Bot routine webhook

Subscribe

What it does
This open-source repo is a Cloudflare Worker that relays Discord slash commands to a Grok Bot routine webhook, so a routine can be triggered from Discord.
Scenarios
Watch PRs / repos
What the source covers
  • Author & original linkYes
  • What it doesYes
  • Verbatim source excerptYes
  • Screenshots / mediaNot in source
  • Steps / chaptersYes
  • Verbatim prompt / configNot in source
  • Results / numbersNot in source
  • Risk notesYes
  • Related entriesYes

— means the source doesn't say; we don't fill it in.

Verbatim source excerpt
hunvreus/grokbot-discord
Cloudflare Worker that relays Discord slash commands to a Grok Bot routine webhook.
hunvreus · · Open original ↗

From the project README, verbatim and untranslated.

Steps / points from the source
  1. Discord's Interactions Endpoint must answer a PING with {"type":1} before Discord will save the URL.
  2. Every request is signed with Ed25519. The endpoint must verify the signature and return 401 when it is wrong. Discord sends deliberately bad signatures to ch……
  3. The endpoint must answer within 3 seconds, in Discord's response format.
  4. The routine webhook needs its key in an Authorization header, and Discord can't add custom headers.
  5. Discord POSTs the slash command to the Worker.
  6. The Worker verifies the signature and checks the user, server and channel allowlists. If something is wrong, it replies with a message only the sender can se……
  7. The Worker answers with a deferred response, so Discord shows " is thinking...".
  8. In the background, the Worker POSTs the command to the routine webhook as JSON (see Payload format).

Verbatim from the source, untranslated.

Prompt

The source does not include a prompt you can copy verbatim.

How to copy
  1. Open the repo: github.com/hunvreus/grokbot-discord ↗
  2. Read the README, send the repo link to your Bot and have it reproduce it
  3. Get it working small first, then add a routine
Risks and limits
  • Scheduled runs keep consuming usage: start at a low frequency and raise it once it is stable
  • The author's result may not reproduce for you; the original post is the reference
Usage estimate
Estimate with the metal calculator