line-bot-sdk: Haskell SDK for LINE Messaging API

[ bsd3, library, network, program, web ] [ Propose Tags ]

A Servant library for building LINE chatbots. This package is composed of the following modules:

To get started, see the documentation for the Line.Bot.Client and Line.Bot.Webhook modules below.


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.2.0.0, 0.3.0.0, 0.4.0.0, 0.5.0.0, 0.5.0.1, 0.5.0.2, 0.5.1.0
Dependencies aeson (>=1.4.2 && <1.5), base (>=4.7 && <5), base64-bytestring (>=1.0.0 && <1.1), bytestring (>=0.10.8 && <0.11), cryptohash-sha256 (>=0.11.101 && <0.12), errors (>=2.3.0 && <2.4), exceptions (==0.10.*), http-api-data (==0.4.*), http-client (>=0.5.14 && <0.7), http-client-tls (>=0.3.5 && <0.4), http-types (>=0.12.2 && <0.13), line-bot-sdk, monad-control (==1.0.*), mtl (>=2.2.2 && <2.3), scientific (>=0.3.6 && <0.4), servant (==0.15.*), servant-client (==0.15.*), servant-client-core (==0.15.*), servant-server (==0.15.*), streaming (==0.2.*), string-conversions (>=0.4.0 && <0.5), text (>=1.2.3 && <1.3), time (>=1.8.0 && <1.9), transformers (>=0.5.5 && <0.6), transformers-base (==0.4.*), wai (>=3.2.2 && <3.3), wai-extra (>=3.0.25 && <3.1), warp (>=3.2.26 && <3.3) [details]
License BSD-3-Clause
Copyright (c) 2018 Alexandre Moreno
Author Alexandre Moreno
Maintainer Alexandre Moreno <alexmorenocano@gmail.com>
Category Network, Web
Home page https://github.com/moleike/line-bot-sdk#readme
Bug tracker https://github.com/moleike/line-bot-sdk/issues
Source repo head: git clone https://github.com/moleike/line-bot-sdk
Uploaded by moleike at Sat May 25 15:06:44 UTC 2019
Distributions NixOS:0.5.1.0
Executables echo-server
Downloads 563 total (158 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2019-05-25 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for line-bot-sdk-0.5.1.0

[back to package description]

line-bot-sdk Build Status

Servant library for building LINE chatbots.

Features:

  • Servant combinator LineReqBody for validation of request signatures using the channel secret. This is required to distinguish legitimate requests sent by LINE from malicious requests

  • Bindings for (most) of the Messaging APIs

Installation

From Hackage

line-bot-sdk is available on Hackage. Using the cabal-install tool:

cabal update
cabal install line-bot-sdk

From source

Building from source can be done using stack or cabal:

git clone github.com/moleike/line-bot-sdk.git
cd line-bot-sdk
stack install # Alternatively, `cabal install`

Documentation

The documentation for the latest release is available on Hackage.

Usage

{-# LANGUAGE OverloadedStrings #-}

import Data.String (fromString)
import Line.Bot.Client (Line, getProfile, runLine)
import Line.Bot.Types (Profile)
import System.Environment (getEnv)

profile :: Line Profile
profile = getProfile "U4af4980629..."

main = do
  token <- fromString <$> getEnv "CHANNEL_TOKEN"
  result <- runLine profile token
  case result of
    Left err -> print err
    Right profile -> print profile

See the examples/ directory for more comprehensive examples.

Contribute

Please report bugs via the github issue tracker.

Acknowledgments

Thanks to the authors of servant-github, for inspiration.