Skip to content

zabirauf/phoenix_microsoftbot

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

MIT licensed hex.pm version Build Status Inline docs Made with Spacemacs

Phoenix Microsoft Bot

This library allows for easy creation of the web API that the Microsoft bot framework can connect to.

Documentation

API documentation is available at https://hexdocs.pm/phoenix_microsoftbot

Installation

  1. Add ex_microsoftbot to your list of dependencies in mix.exs:

    def deps do [{:phoenix_microsoftbot, "~> 1.0.0"}] end

Usage

To create the Web API for Microsoft Bot Framework to connect to requires three steps

  1. Defining the controller
defmodule MessageController do
  use MicrosoftBot.Phoenix.Controller

  def message_received(%MicrosoftBot.Models.Message{} = message) do
    # ...
    # send message back or resp(conn, 200, "")
  end
end
  1. In the routes.ex
defmodule YourApp.Router do
  use YourApp.Web, :router

  # Add the following two lines
  use MicrosoftBot.Router
  microsoftbot_routes "/api/message", MessageController
end
  1. Add :microsoftbot configuration in prod.exs
config :microsoftbot,
  app_id: "APP_ID",
  app_secret: "APP_SECRET"

About

Phoenix controller for creating the endpoint for Microsoft Bot connectors

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages