/ai slash command that generates a GPT-powered reply directly inside a Discord thread. The bot reads the thread’s message history, optionally accepts a custom prompt, then streams a response using the gpt-5.2-codex model. Only members with the Manage Messages permission can invoke the command.
The
/ai command only works inside threads (announcement, public, or private). Using it in a regular channel returns an ephemeral error message.How it works
Run /ai in a thread
Use the
/ai command, optionally passing a prompt string and a reasoning level (low, medium, or high). The default reasoning level is medium.Bot starts thinking
The bot replies with an ephemeral message — “The clanker is thinking…” — and a Cancel button. The message updates with a tool-call counter as the model works.
Review the response
When the model finishes, the ephemeral message is replaced with the generated text and an Accept button.
AI tools
The model has access to three tools that let it read and search the effect-smol repository at generation time.read
Reads a file (or a line range) from the Effect repository.
rg
Runs ripgrep inside the repository to search for patterns.
glob
Finds files matching a glob pattern inside the repository.
AiResponse.ts
Effect repository context
The bot clones effect-smol on startup and pulls the latest changes every 15 minutes so responses always reflect current source code.EffectRepo.ts
LLMS.md from the repository root so the model understands the project’s API conventions before diving into individual files.
Models
| Purpose | Model |
|---|---|
| Response generation | gpt-5.2-codex |
| Title generation (AutoThreads) | gpt-5.2 |
Configuration
| Environment variable | Required | Description |
|---|---|---|
OPENAI_API_KEY | Yes | OpenAI API key used for all AI features. |
Permissions
The/ai command requires the Manage Messages (ManageMessages) permission. Members without this permission cannot invoke it.