Botlead.Client.Behaviour behaviour (botlead v0.2.4)

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()

Specs

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

Specs

message() :: map()

Specs

state() :: map()

Link to this section Callbacks

Link to this callback

get_initial_state(t, t)

Specs

get_initial_state(String.t(), Keyword.t()) :: state()

Default state for client session.

Specs

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

Name generator for client session servers.

Link to this callback

message_delivered(delivery_action, message, state)

Specs

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, t)

Specs

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.

Specs

router() :: module()

Module for message routing.