# ── Required ────────────────────────────────────────────────────────────── # Enable the extension. PI_DISCORD_ENABLED=true # Your Discord bot token (from https://discord.com/developers/applications). PI_DISCORD_BOT_TOKEN=your-bot-token-here # Comma-separated list of Discord user IDs allowed to control Pi. PI_DISCORD_USER_IDS=your-user-id-here # ── Channel mode ────────────────────────────────────────────────────────── # # Two mutually exclusive modes: # # per-project (default) — bot creates a dedicated channel for every # project directory inside the configured guild. # Requires PI_DISCORD_GUILD_ID. # # single-channel — bot sends everything to one static channel. # Requires PI_DISCORD_CHANNEL_ID. # Toggle between per-project channel creation (true) or single-channel mode (false). PI_DISCORD_CREATE_CHANNEL_PER_PROJECT=true # ── Per-project mode (required when PI_DISCORD_CREATE_CHANNEL_PER_PROJECT=true) # Guild (server) ID where per-project channels will be created. PI_DISCORD_GUILD_ID=your-guild-id-here # ── Single-channel mode (required when PI_DISCORD_CREATE_CHANNEL_PER_PROJECT=false) # Discord channel ID the bot should use for all messages. # PI_DISCORD_CHANNEL_ID=your-channel-id-here # ── Threads ──────────────────────────────────────────────────────────────── # Create a dedicated thread per Pi session (default: true). PI_DISCORD_CREATE_THREAD_PER_SESSION=true # Prefix for thread names. Final name: {prefix}-{5-char-slug} PI_DISCORD_THREAD_NAME_PREFIX=pi # Thread auto-archive duration in minutes. Options: 60, 1440 (1 day), 4320 (3 days), 10080 (1 week). PI_DISCORD_THREAD_AUTO_ARCHIVE_MINUTES=10080 # ── Streaming ────────────────────────────────────────────────────────────── # Enable live message streaming (edits messages as the assistant generates). # Default: false (sends one message per response). PI_DISCORD_STREAM_MESSAGES=false # ── Rendering ────────────────────────────────────────────────────────────── # Show user input in Discord (default: true). PI_DISCORD_RENDER_USER_INPUT=true # Show tool calls in Discord (default: true). PI_DISCORD_RENDER_TOOL_CALLS=true # Show tool results in Discord (default: true). PI_DISCORD_RENDER_TOOL_RESULTS=true # Show chain-of-thought / reasoning in Discord (default: false). PI_DISCORD_RENDER_REASONING=false # ── Formatting ───────────────────────────────────────────────────────────── # Interval between stream edits in ms (only when streaming is enabled). PI_DISCORD_EDIT_INTERVAL_MS=1100 # Interval between new message sends in ms. PI_DISCORD_CREATE_INTERVAL_MS=600 # Max characters per message (Discord limit is 2000, we use 1990 to be safe). PI_DISCORD_MAX_CHARS=1900 # Max characters for tool argument summaries. PI_DISCORD_TOOL_ARGS_MAX_CHARS=800 # Max characters for tool result summaries. PI_DISCORD_TOOL_RESULT_MAX_CHARS=1000 # Optional prefix prepended to every Discord message. PI_DISCORD_PREFIX= # Label shown when messages arrive from Discord, e.g. "[discord]". PI_DISCORD_STEER_LABEL=[discord] # ── Slash commands ──────────────────────────────────────────────────────── # Register bridge commands as guild-scoped slash commands. PI_DISCORD_REGISTER_SLASH_COMMANDS=false PI_DISCORD_SLASH_COMMAND_GUILD_IDS=your-guild-id-here # ── Session launcher (HTTP server) ──────────────────────────────────────── # Enable the /new-session HTTP endpoint. PI_DISCORD_LAUNCHER_ENABLED=false # Port for the launcher server. PI_DISCORD_LAUNCHER_PORT=8765 # Secret to restrict /new-session access. Leave empty for no auth. PI_DISCORD_LAUNCHER_SECRET= # Command and args used to spawn new Pi sessions. PI_DISCORD_SPAWN_COMMAND=pi PI_DISCORD_SPAWN_ARGS= # ── Overrides ───────────────────────────────────────────────────────────── # Path to a custom .env file. Default: ~/.pi/.env # PI_DISCORD_ENV_FILE=/path/to/custom/.env