molecule-core/platform/internal/channels
Molecule AI DevOps Engineer 1b9be1e289 feat(channels): add Discord adapter (#625)
Implements DiscordAdapter conforming to the ChannelAdapter interface,
using Discord Incoming Webhooks for outbound messages and the Interactions
endpoint for inbound slash commands.

Changes:
- platform/internal/channels/discord.go: DiscordAdapter + splitMessage
  helper (Discord enforces 2000-char limit; long messages are split at
  newline/space boundaries). ParseWebhook handles type-1 PING (returns
  nil so the router layer can respond), type-2 APPLICATION_COMMAND, and
  type-3 MESSAGE_COMPONENT payloads. ValidateConfig rejects non-discord
  webhook URLs (SSRF guard matches Slack pattern).
- platform/internal/channels/discord_test.go: 20 unit tests covering
  Type/DisplayName, ValidateConfig (valid + 5 invalid cases), SendMessage
  error paths, ParseWebhook (PING / slash command / DM user / unknown type /
  invalid JSON), StartPolling, GetAdapter registry lookup, ListAdapters
  inclusion, and splitMessage edge cases.
- platform/internal/channels/registry.go: register "discord" adapter.
- .env.example: document DISCORD_WEBHOOK_URL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 07:02:50 +00:00
..
adapter.go initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
channels_test.go feat(channels): add Slack adapter with webhook URL validation (#384) 2026-04-16 11:14:31 +00:00
discord_test.go feat(channels): add Discord adapter (#625) 2026-04-17 07:02:50 +00:00
discord.go feat(channels): add Discord adapter (#625) 2026-04-17 07:02:50 +00:00
lark_test.go feat(channels): Lark / Feishu adapter (outbound webhook + Events API inbound) 2026-04-16 07:10:58 -07:00
lark.go feat(channels): Lark / Feishu adapter (outbound webhook + Events API inbound) 2026-04-16 07:10:58 -07:00
manager.go fix(security): scope PausePollersForToken to requesting workspace (closes #329) 2026-04-15 21:22:50 -07:00
registry.go feat(channels): add Discord adapter (#625) 2026-04-17 07:02:50 +00:00
secret_test.go fix(security): encrypt channel_config bot_token at rest (closes #319) 2026-04-15 21:09:34 -07:00
secret.go fix(security): encrypt channel_config bot_token at rest (closes #319) 2026-04-15 21:09:34 -07:00
slack.go feat(channels): add Slack adapter with webhook URL validation (#384) 2026-04-16 11:14:31 +00:00
telegram.go initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00