botlead v0.1.7 Botlead.Client.Behaviour behaviour

Callback which require implementation by custom bot clients.

Link to this section Summary

Callbacks

Default state for client session

Name generator for client session servers

Callback for handling message delivery, replaces the current state

Transform new message from bot into connection object. The place to put routing business logic

Module for message routing

Link to this section Types

Link to this type

delivery_action()
delivery_action() :: :sent | :edited | :deleted

Link to this type

message()
message() :: map()

Link to this type

state()
state() :: map()

Link to this section Callbacks

Link to this callback

get_initial_state(arg0, arg1)
get_initial_state(String.t(), Keyword.t()) :: {:ok, state()} | {:error, any()}

Default state for client session.

Link to this callback

instance(arg0)
instance(String.t()) :: atom()

Name generator for client session servers.

Link to this callback

message_delivered(delivery_action, message, state)
message_delivered(delivery_action(), message(), state()) :: state()

Callback for handling message delivery, replaces the current state.

Link to this callback

message_to_conn(message, state, arg2)
message_to_conn(message(), state(), Keyword.t()) :: GenRouter.Conn.t()

Transform new message from bot into connection object. The place to put routing business logic.

Link to this callback

router()
router() :: module()

Module for message routing.