feat(discord): add per-channel auto-thread exclusion list - #4611
Closed
Helmi wants to merge 1 commit into
Closed
Conversation
Add discord.no_auto_thread_channels config option (also settable via DISCORD_NO_AUTO_THREAD_CHANNELS env var) that accepts a comma-separated list of channel IDs where auto-threading should be skipped. This is useful when auto_thread is globally enabled but certain channels (e.g. shared bot-to-bot collaboration channels) should keep conversations in the main channel instead of splitting them into threads. Follows the same pattern as discord.free_response_channels — accepts both YAML list and comma-separated string formats in config.yaml.
Contributor
|
Thanks for the contribution! This functionality is already available on Evidence:
Usage with the existing feature: discord:
auto_thread: true
no_thread_channels:
- '1489269514184032318'This is an automated hermes-sweeper review. |
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
discord.no_auto_thread_channelsconfig option that lets users exclude specific channels from auto-threading while keeping it enabled globally.Motivation
When
discord.auto_threadis enabled, every @mention in a text channel spawns a new thread. This is great for most channels (keeps conversations isolated), but some channels — like shared collaboration channels with multiple bots or group discussion channels — work better without auto-threading.Currently the only option is to disable
auto_threadglobally, which is all-or-nothing.Changes
gateway/platforms/discord.py: CheckDISCORD_NO_AUTO_THREAD_CHANNELSenv var before creating auto-threads. If the message's channel ID is in the exclusion list, skip thread creation.gateway/config.py: Bridgediscord.no_auto_thread_channelsfrom config.yaml to theDISCORD_NO_AUTO_THREAD_CHANNELSenv var. Supports both YAML list and comma-separated string formats (same pattern asfree_response_channels).tests/gateway/test_discord_free_response.py: Two new tests — one verifying excluded channels skip auto-threading, one verifying non-excluded channels still auto-thread normally.Usage
Or via env var:
Tests
All 17 tests in
test_discord_free_response.pypass (including 2 new ones).