Skip to main content
Open in playground is a message context menu command — not a slash command. You access it by right-clicking (or long-pressing on mobile) any message, then selecting Apps → Open in playground. The command extracts code blocks from the message, base64url-encodes them, and returns an ephemeral link to the Effect Playground.

Usage

  1. Right-click a message containing a code block.
  2. Select Apps.
  3. Select Open in playground.
The response is always ephemeral — only you can see the generated link.

Behavior

1

Extract code blocks

The bot scans the message content for fenced code blocks using the following pattern:
const extractCode = (content: string): Option.Option<string> => {
  const codeBlock = content.matchAll(/```.*$([\s\S]*?)```/gm)
  const items = [...codeBlock]
  return items.length > 0
    ? Option.some(items.map(([, code]) => code.trim()).join("\n\n\n"))
    : Option.none()
}
If the message contains multiple code blocks, their contents are joined with two blank lines between them.
2

Encode the code

The extracted code is base64url-encoded using Encoding.encodeBase64Url, then appended to the playground URL:
https://effect.website/play/?code={base64url-encoded code}
3

Return the link

The bot responds with an ephemeral message:
Here is your playground link.

Error cases

If the message contains no fenced code blocks, the bot responds with:
No code snippets were found in the message.
If the generated response string exceeds 1950 characters (meaning the encoded URL is too long), the bot responds with:
The code snippet is too long to be displayed in a single message.
This typically happens when the code block is very large. In this case, paste the code directly into effect.website/play instead.

Build docs developers (and LLMs) love