Current section
Files
Jump to
Current section
Files
lib/line-message/reply.ex
defmodule LineMessage.Reply do
@api_url "https://api.line.me/v2/bot/message/reply"
def to(messages, replyToken) when messages != [] do
{:ok, body} = %{
replyToken: replyToken,
messages: messages
} |> Poison.encode
HTTPotion.post @api_url, [
body: body,
headers: [
"Content-Type": "application/json",
"Authorization": "Bearer " <>
Application.get_env(:line_message, :access_token)
]]
:ok
end
end