Skip to main content
This page documents the specific platform implementations within the Palyra connector ecosystem. While palyra-connector-core defines the lifecycle and traits, the platform-specific crates handle the nuances of Discord, Slack, and Telegram, including authentication handshakes, message parsing, and attachment handling.

Discord Connector (palyra-connector-discord)

The Discord connector is the primary production-ready external channel for Palyra. It allows the daemon to interact with users via Direct Messages (DMs) and Guild (Server) channels.

Identity and Principal Mapping

Discord identities are mapped to Palyra principals using a canonical format to ensure consistency across the system.

Security Handshake and Onboarding

The onboarding process for Discord is managed through a multi-step administrative flow via the CLI and Admin API. This ensures that the bot has the necessary permissions and that the operator has verified the connection.
  1. Probe Phase: The run function in the Discord setup module calls the /admin/v1/channels/discord/onboarding/probe endpoint crates/palyra-cli/src/commands/channels/connectors/discord/setup.rs#33-46. This validates the provided bot token and checks for required permissions (e.g., message history, file attachments).
  2. Configuration Phase: The operator configures the inbound_scope (DMs only vs. Guild channels) and sets allow_from/deny_from filters crates/palyra-cli/src/commands/channels/connectors/discord/setup.rs#53-55.
  3. Apply Phase: The configuration is committed via the /admin/v1/channels/discord/onboarding/apply endpoint crates/palyra-cli/src/commands/channels/connectors/discord/setup.rs#73-95. This persists the ConnectorInstanceSpec crates/palyra-daemon/src/channels/discord.rs#18-21.

Implementation Diagram: Discord Setup Flow

The following diagram illustrates how the CLI setup command interacts with the Daemon’s Discord integration logic. “Discord Setup Logic Flow” Sources: crates/palyra-cli/src/commands/channels/connectors/discord/setup.rs#10-97, crates/palyra-daemon/src/channels/discord.rs#13-21

Message and Attachment Processing

The Discord connector implements the ConnectorAdapter trait to handle bidirectional communication:

Other Platform Stubs

Palyra includes stubs for Slack and Telegram to define the architectural path for future integrations. These currently return ConnectorAvailability::Deferred crates/palyra-connectors/src/connectors/slack.rs#19.

Slack and Telegram Status

PlatformClassAvailabilityBehavior
SlackSlackConnectorAdapterDeferredReturns PermanentFailure on send crates/palyra-connectors/src/connectors/slack.rs#13-30
TelegramTelegramConnectorAdapterDeferredReturns PermanentFailure on send crates/palyra-connectors/src/connectors/telegram.rs#13-30

Echo Connector (Internal Testing)

The EchoConnectorAdapter is used for internal integration testing and development. It simulates a functional connector without requiring external network access.

Key Features

Data Flow: Outbound Echo Message

This diagram bridges the abstract OutboundMessageRequest to the concrete EchoConnectorAdapter implementation. “Echo Connector Data Flow” Sources: crates/palyra-connectors/src/connectors/echo.rs#34-75, crates/palyra-connectors/src/connectors/echo.rs#88-91

Summary of Default Adapters

The default_adapters() function in the palyra-connectors crate initializes the set of active connectors available to the ConnectorSupervisor crates/palyra-connectors/src/connectors/mod.rs#16-18.
Connector KindImplementation ClassProduction Ready
EchoEchoConnectorAdapterNo (Test Only)
DiscordDiscordConnectorAdapterYes
SlackSlackConnectorAdapterNo (Stub)
TelegramTelegramConnectorAdapterNo (Stub)
Sources: crates/palyra-connectors/src/connectors/mod.rs#16-18, crates/palyra-connectors/src/connectors/mod.rs#34-41