Skip to content

Reply in-thread for channel @-mentions #29

Closed

Description

@scarolan

Right now @data in a channel replies at top level, which floods the channel for any back-and-forth conversation. Threads keep the noise contained.

Change

In the direct-mention handler in app.js, pass thread_ts: message.thread_ts || message.ts to say(). If the user @-mentions Data inside an existing thread, the reply stays in that thread; if they @-mention at top level, a new thread starts.

Side effect to consider

The current handler explicitly drops messages with thread_ts set (likely to avoid Data replying to its own thread cascades). With the new behavior, Data should be willing to chat inside threads it started — needs a check like "thread_ts is set, but the root of the thread is a message Data replied to, so keep going."

Probably easiest: track which thread_ts values Data is "in" via Keyv with a short TTL, or just match message.parent_user_id === context.botUserId.

DMs are unaffected — they have no thread concept that matters.

Activity

  1. scarolan commented on Jun 14, 2026

    @scarolan
    OwnerAuthor

    Shipped on main as part of the work merged via PR #30.

    Channel @-mentions now reply in-thread: continues the existing thread if the mention was inside one, otherwise starts a new thread rooted at the mention. DMs reply flat as before.

    Bail conditions in the direct-mention handler tightened to just { bot_profile, bot_id, edited } — removing the over-broad thread_ts / parent_user_id bails. Bot loops are still prevented by the bot_id/bot_profile guard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions