agala v2.0.0 Agala.Conn

The Agala connection.

This module defines a Agala.Conn struct. This struct contains both request and response data.

Request fields

These fields contain request information:

  • request - request data structure. It’s internal structure depends on provider type.

Link to this section Summary

Functions

Halts the Agala.Chain pipeline by preventing further chains downstream from being invoked. See the docs for Agala.Chain.Builder for more information on halting a Chain pipeline

Specifies the name for the bot, which will send the response back to side APIs

Specifies the lambda function that will be called after the result of provider’s respponse to the bot’s response will appear. The lambda shuld have only one parameter - Agala.Conn.t for current connection. It’ll have request with request to bot, response with response from bot, and fallback with response sending results

Link to this section Types

Link to this type t()
t() :: %Agala.Conn{fallback: function | Map.t, halted: boolean, multi: Agala.Conn.Multi.t, request: Map.t, request_bot_params: Agala.BotParams.t, response: Map.t, responser_name: String.t | Atom}

Link to this section Functions

Link to this function halt(conn)
halt(t) :: t

Halts the Agala.Chain pipeline by preventing further chains downstream from being invoked. See the docs for Agala.Chain.Builder for more information on halting a Chain pipeline.

Link to this function send_to(conn, name)

Specifies the name for the bot, which will send the response back to side APIs.

Link to this function with_fallback(conn, fallback_callback)

Specifies the lambda function that will be called after the result of provider’s respponse to the bot’s response will appear. The lambda shuld have only one parameter - Agala.Conn.t for current connection. It’ll have request with request to bot, response with response from bot, and fallback with response sending results.