Copy library / Guides / Grok Bot
grokbot-discord: relay Discord slash commands to a Grok Bot routine webhook
# grokbot-discord:把 Discord 斜杠命令转发到 Grok Bot 例程 webhook Source: https://github.com/hunvreus/grokbot-discord Author: hunvreus 这个开源仓库是一个 Cloudflare Worker,把 Discord 的斜杠命令转发到 Grok Bot 例程的 webhook,从而在 Discord 里触发 Grok Bot。
- 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
- Discord's Interactions Endpoint must answer a PING with {"type":1} before Discord will save the URL.
- 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……
- The endpoint must answer within 3 seconds, in Discord's response format.
- The routine webhook needs its key in an Authorization header, and Discord can't add custom headers.
- Discord POSTs the slash command to the Worker.
- 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……
- The Worker answers with a deferred response, so Discord shows " is thinking...".
- 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
- Open the repo: github.com/hunvreus/grokbot-discord ↗
- Read the README, send the repo link to your Bot and have it reproduce it
- 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