Live adapter. A thin, owned Req-based Slack Web API
client — the SAME app code that renders in the fake dev UI (Local) actually
posts to Slack when this adapter is configured.
# config/prod.exs
config :my_app, MyApp.Slack,
adapter: Slackbox.Adapters.Live,
token: System.get_env("SLACK_BOT_TOKEN")Config keys
Read from the merged config keyword list (adapter config plus per-call opts):
:token— Slack bot token (xoxb-...). Required for Web API methods (post_message,post_ephemeral,update,delete,open_view); a missing token yields{:error, :missing_token}. Not needed forrespond, which posts to a signedresponse_url.:base_url— Slack Web API base. Defaults to"https://slack.com/api"; override it to point at a fake server.:req_options— keyword list merged into everyReqrequest. Handy for a testplug:stub, or for app-level timeouts/retries. Defaults to[].
Return shapes
post_message/update→{:ok, %{ts: ..., channel: ...}}open_view→{:ok, %{view_id: ...}}post_ephemeral→{:ok, %{}}(with:message_tswhen Slack returns one)delete/respond→{:ok, %{}}- Slack API failure →
{:error, {:slack, reason}} HTTP 429 →
{:error, {:rate_limited, retry_after_seconds | nil}}respondnon-200 →{:error, {:http, status}}- transport error →
{:error, exception}
Errors are always returned as tagged tuples; the adapter never raises into the caller.