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
- Right-click a message containing a code block.
- Select Apps.
- Select Open in playground.
The response is always ephemeral — only you can see the generated link.
Behavior
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. 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}
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.