Skip to content

feat: add Discord bridge (host-side, Telegram-style) - #422

Closed
bysejin wants to merge 1 commit into
NVIDIA:mainfrom
bysejin:feature/discord-bridge
Closed

feat: add Discord bridge (host-side, Telegram-style)#422
bysejin wants to merge 1 commit into
NVIDIA:mainfrom
bysejin:feature/discord-bridge

Conversation

@bysejin

@bysejin bysejin commented Mar 19, 2026

Copy link
Copy Markdown

Description

This PR implements a host-side Discord bridge for NemoClaw, following the same architecture as the existing Telegram bridge.

As discussed in #213 and upstream issue #409, a host-side bridge is currently required because the sandbox proxy does not support CONNECT tunneling and local DNS resolution for WebSockets (gateway.discord.gg), preventing the native Discord plugin from running inside the sandbox.

Proposed Changes

  • Added scripts/discord-bridge.js using discord.js
  • Integrated bridge lifecycle into scripts/start-services.sh and bin/nemoclaw.js
  • Added per-channel conversation continuity via channel-scoped --session-id (e.g. dc-ch-${channelId})
  • Added deployment guide in docs/deployment/set-up-discord-bridge.md

Notes

  • All 52 existing tests pass successfully
  • Slash commands and advanced per-channel presence are scoped for a follow-up PR, as discussed with @subrih

Closes #213

- Add scripts/discord-bridge.js (host-side bridge using discord.js)
- Update scripts/start-services.sh (service lifecycle integration)
- Add docs/deployment/set-up-discord-bridge.md (setup guide)
- Update docs/reference/commands.md (updated command docs)
- Update bin/nemoclaw.js (credential forwarding in deploy flow)
- Add discord.js dependency to package.json
@psorensen-nvidia psorensen-nvidia added documentation enhancement New capability or improvement request labels Mar 19, 2026
phanisaimunipalli added a commit to phanisaimunipalli/NemoClaw that referenced this pull request Mar 20, 2026
Add scripts/discord-bridge.js following the same architecture as
the Telegram bridge. Runs on the host because the sandbox proxy
does not support CONNECT tunneling for WebSockets, which the
Discord gateway requires (see NVIDIA#409).

- Per-channel session continuity via channel-scoped session IDs
- Message chunking at Discord's 2000-character limit
- NEMOCLAW_MODEL and SANDBOX_NAME env var support
- ALLOWED_GUILD_IDS for access control
- !reset command to clear a channel session
- Typing indicator while the agent runs

Updates start-services.sh to start/stop the Discord bridge
alongside the Telegram bridge when DISCORD_BOT_TOKEN is set.

Adds docs/deployment/set-up-discord-bridge.md with setup
instructions for creating a Discord application, inviting the
bot, and configuring access control.

Adds discord.js ^14.16.3 to package.json dependencies.

Closes NVIDIA#422.
@wscurran wscurran added integration: discord Discord integration or channel behavior integration: telegram Telegram integration or channel behavior labels Mar 20, 2026
phanisaimunipalli added a commit to phanisaimunipalli/NemoClaw that referenced this pull request Mar 29, 2026
Add scripts/discord-bridge.js following the same architecture as
the Telegram bridge. Runs on the host because the sandbox proxy
does not support CONNECT tunneling for WebSockets, which the
Discord gateway requires (see NVIDIA#409).

- Per-channel session continuity via channel-scoped session IDs
- Message chunking at Discord's 2000-character limit
- NEMOCLAW_MODEL and SANDBOX_NAME env var support
- ALLOWED_GUILD_IDS for access control
- !reset command to clear a channel session
- Typing indicator while the agent runs

Updates start-services.sh to start/stop the Discord bridge
alongside the Telegram bridge when DISCORD_BOT_TOKEN is set.

Adds docs/deployment/set-up-discord-bridge.md with setup
instructions for creating a Discord application, inviting the
bot, and configuring access control.

Adds discord.js ^14.16.3 to package.json dependencies.

Closes NVIDIA#422.
@wscurran

Copy link
Copy Markdown
Contributor

Thanks for the Discord bridge implementation. The bridge-core pattern has continued to evolve since March (the Telegram bridge is established on main, Slack and Discord are still in progress). Could you rebase against main and check for overlap with other open Discord bridge work (#458)? Once it's current we can coordinate the review. Happy to discuss the right landing path.

@wscurran

Copy link
Copy Markdown
Contributor

Thanks for this — a host-side Discord bridge is a frequently requested integration. We're doing an evaluation of the Discord bridge approach before committing to a merge path, as there's also a competing implementation in #458.

We'll be reviewing both PRs together to decide on direction. We'll follow up here once we have a clearer picture. No action needed on your end for now — we'll reach out if we need more information.

@wscurran

Copy link
Copy Markdown
Contributor

Thanks for contributing this. Discord support has since landed via a different approach — the host-side bridge script architecture was replaced with OpenShell-managed channels and a discord.yaml policy preset that routes Discord traffic natively inside the sandbox. scripts/discord-bridge.js is no longer part of the codebase.

Closing as superseded by the new messaging channel architecture. Feel free to reopen if you see gaps in the current Discord support.

@wscurran wscurran closed this Apr 21, 2026
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output area: integrations Third-party service integration behavior area: providers Inference provider integrations and provider behavior feature PR adds or expands user-visible functionality and removed priority: medium labels Jun 3, 2026
@wscurran wscurran added area: docs Documentation, examples, guides, or docs build and removed documentation enhancement New capability or improvement request labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output area: docs Documentation, examples, guides, or docs build area: integrations Third-party service integration behavior area: providers Inference provider integrations and provider behavior feature PR adds or expands user-visible functionality integration: discord Discord integration or channel behavior integration: telegram Telegram integration or channel behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Add Discord bridge (host-side, similar to Telegram bridge)

3 participants