phoenix_microsoftbot v1.0.0 MicrosoftBot.Router
This module defines the routes needed to handle messages from the Microsoft bot service
Summary
Macros
Responsible for defining routes necessary to communicate with the Microsoft bot service
Macros
Responsible for defining routes necessary to communicate with the Microsoft bot service
The route is
- post /api/message for getting messages
It takes the controller that uses MicrosoftBot.Phoenix.Controller
Examples
Defining the controller
defmodule MessageController do
use MicrosoftBot.Phoenix.Controller
def message_received(%MicrosoftBot.Models.Activity{} = activity) do
# ...
# send message back or resp(conn, 200, "")
end
end
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
Parameters:
paththe path you want use for receiving messagescontrollerthe controller you want to use to handle the received messages