Skip to content

Support private threads for confidential bot conversations #568

@chaodu-agent

Description

@chaodu-agent

Summary

When a user mentions the bot in a Discord channel, OpenAB currently creates a public thread that is visible to everyone in the channel. We should support creating private threads (GUILD_PRIVATE_THREAD, type 12) so that only the initiating user (and server moderators) can see the conversation.

Motivation

Some conversations with the bot may contain sensitive information (e.g. billing, personal configs, security topics). Users should have the option to start a private conversation directly in a channel without others being able to see the thread content.

Proposed Design

Discord API Mechanism

  • When creating a thread, pass type: 12 (GUILD_PRIVATE_THREAD) and invitable: false to the Discord API
  • Only the initiating user and members with MANAGE_THREADS permission will be able to see the thread
  • The bot should add the initiating user as a thread member via PUT /channels/{thread_id}/thread-members/{user_id}

User-Facing Trigger Options

  1. Keyword/emoji trigger — User includes a marker like 🔒 or /private in their mention message to request a private thread
  2. Channel-level default — Admins can configure specific channels to always create private threads
  3. Both options can coexist: channel default + per-message override

Example Flow

  1. User sends: @Bot 🔒 help me check my billing
  2. Bot detects the 🔒 marker
  3. Bot creates a private thread (type 12, invitable: false)
  4. Bot adds the user to the thread
  5. Bot optionally deletes the original message in the channel to avoid leaking the question
  6. Bot replies inside the private thread

Requirements

  • Support GUILD_PRIVATE_THREAD (type 12) when creating threads
  • Support invitable: false to prevent non-moderators from adding others
  • Detect private thread trigger (emoji/keyword) from user message
  • Optionally support channel-level configuration for default thread mode
  • Optionally delete the original mention message to prevent content leakage

Notes

  • Private threads require the server to have Boost Level 2
  • Moderators with MANAGE_THREADS can always see private threads — this is a Discord platform limitation
  • The bot itself is automatically a member of threads it creates

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions