<a href="http://github.com/syl20bnr/spacemacs"><img src="https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg" alt="Made with Spacemacs"></a>
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
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
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 endIn the
routes.exdefmodule YourApp.Router do use YourApp.Web, :router # Add the following two lines use MicrosoftBot.Router microsoftbot_routes "/api/message", MessageController endAdd
:microsoftbotconfiguration inprod.exsconfig :microsoftbot, app_id: "APP_ID", app_secret: "APP_SECRET"