Sends a rendered outbound message to one of four destinations.
adapters is a map of platform => {adapter_module, conn}, so a single gateway
delivers across every connected platform. A destination is one of:
{:direct, route}-- reply to the originating chat.{:home, route}-- a configured home channel (cron and background results).{:cross_platform, route}-- a different platform's chat.{:target, "platform:chat_id"}-- an explicit target string, e.g."telegram:-1001234567890".
All four resolve to a Raxol.Gateway.Route; delivery then sends through that
route's platform adapter. A target string's platform must match a connected
adapter (no String.to_atom/1 on the string).
Summary
Functions
Resolve a destination to a route and send rendered through its adapter.
Resolve a destination to the Route it delivers to.
Types
@type destination() :: {:direct, Raxol.Gateway.Route.t()} | {:home, Raxol.Gateway.Route.t()} | {:cross_platform, Raxol.Gateway.Route.t()} | {:target, String.t()}
Functions
@spec deliver(adapters(), destination(), term()) :: :ok | {:error, term()}
Resolve a destination to a route and send rendered through its adapter.
@spec resolve(destination(), adapters()) :: {:ok, Raxol.Gateway.Route.t()} | {:error, term()}
Resolve a destination to the Route it delivers to.