#22900: fix(discord): set IS_COMPONENTS_V2 flag for v2 components in sendDiscordText/Media
channel: discord
size: XS
Cluster:
Signal and Discord Fixes
## Summary
- Merges the `IS_COMPONENTS_V2` message flag (`1 << 15`) into `buildDiscordMessagePayload()` when v2 components (Containers) are detected
- Without this flag, Discord silently drops v2 components from sent messages
- The fix is centralized in `buildDiscordMessagePayload()` which already detects v2 components via `hasV2Components()`, ensuring all send paths benefit
Previously, only the dedicated components send path (`send.components.ts`) set this flag via `buildDiscordComponentMessageFlags()`. The `sendDiscordText` and `sendDiscordMedia` paths never set it.
Fixes #22565
## Local Validation
- [x] Verified `MessageFlags.IsComponentsV2` import from `discord-api-types/v10`
- [x] Flag is only set when v2 components are present (no change for regular messages)
- [x] `SUPPRESS_NOTIFICATIONS_FLAG` is correctly merged with the v2 flag via bitwise OR
## Scope
XS — 5-line change in one file (import + flag merge logic)
## AI Assistance
Used Claude Code for issue investigation and fix implementation.
## Author
@miloudbelarebia
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR fixes a bug where Discord v2 components (Containers) were silently dropped from messages sent via `sendDiscordText` and `sendDiscordMedia`. The fix centralizes the `MessageFlags.IsComponentsV2` flag logic in `buildDiscordMessagePayload()`, which already detects v2 components via `hasV2Components()`. The flag is properly merged with any existing flags (like `SUPPRESS_NOTIFICATIONS_FLAG`) using bitwise OR, ensuring all send paths now correctly set the flag when needed.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The change is minimal (5 lines), well-scoped, and follows the existing pattern from `send.components.ts` (line 84-87). The flag merge logic correctly uses bitwise OR with proper null coalescing, and the implementation is consistent with Discord's API requirements for v2 components.
- No files require special attention
<sub>Last reviewed commit: 0668aae</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#17254: fix(discord): intercept text-based slash commands instead of forwar...
by robbyczgw-cla · 2026-02-15
71.9%
#20186: fix(discord): thread mediaLocalRoots through reply delivery path
by pvoo · 2026-02-18
71.4%
#20009: fix(discord): immediately defer interactions to prevent timeouts
by Gitjay11 · 2026-02-18
71.1%
#22940: fix(discord): detect voice messages for preflight transcription bef...
by aldoeliacim · 2026-02-21
71.0%
#20488: fix(discord): pass mediaLocalRoots to sendMessageDiscord
by olyashok · 2026-02-19
70.8%
#21463: fix(discord): prevent WebSocket death spiral + fix numeric channel ID…
by akropp · 2026-02-20
70.7%
#22557: fix(discord): coerce exec approval approver IDs to string to preven...
by zwffff · 2026-02-21
70.7%
#17648: fix: Discord guild channel detection using rawMessage.guild_id
by MisterGuy420 · 2026-02-16
70.4%
#20913: fix: intercept Discord embed images to enforce mediaMaxMb
by MumuTW · 2026-02-19
69.9%
#17513: fix(discord): respect groupPolicy in channel config fallback (#4555)
by aronchick · 2026-02-15
69.5%