Direxion

A Microsoft Directline Client in Elixir

Installation

If available in Hex, the package can be installed by adding direxion to your list of dependencies in mix.exs:

def deps do
  [
    {:direxion, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/direxion.

Usage

defmodule DirectlineTest do
  import Direxion
  ...
  activity_response = message(DIRECTLINE_TOKEN_HERE, ACTIVITY_TO_SEND)

The message function is a composite of three underneath functions each of which does the following

Composite Functions

start_conversation

Parameters:

Starts a conversation with directline

start_conversation(DIRECTLINE_TOKEN_HERE)

send_activity

Parameters:

Sends an activity to a given conversation

send_activity(DIRECTLINE_TOKEN_HERE, CONVERSATION_ID, ACTITVITY_TO_SEND)

receive_activities

Parameters:

Receive the activities from a conversation.

receive_activities(DIRECTLINE_TOKEN_HERE, CONVERSATION_ID)