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

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

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]

Properties

Versions 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, 0.5.2, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.7.2
Change log None available
Dependencies aeson (>=1.5.6 && <1.6), base (>=4.14.1 && <4.15), base64-bytestring (>=1.1.0 && <1.2), bytestring (>=0.10.12 && <0.11), cryptohash-sha256 (>=0.11.102 && <0.12), deepseq (>=1.4.4 && <1.5), http-api-data (>=0.4.1.1 && <0.5), http-client (>=0.6.4 && <0.7), http-client-tls (>=0.3.5 && <0.4), http-media (>=0.8.0 && <0.9), http-types (>=0.12.3 && <0.13), mtl (>=2.2.2 && <2.3), servant (>=0.18.2 && <0.19), servant-client (>=0.18.2 && <0.19), servant-client-core (>=0.18.2 && <0.19), servant-server (>=0.18.2 && <0.19), string-conversions (>=0.4.0 && <0.5), text (>=1.2.4 && <1.3), time (>=1.9.3 && <1.10), wai (>=3.2.3 && <3.3) [details]
License BSD-3-Clause
Copyright (c) Alexandre Moreno, 2019-2021
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 2021-08-25T02:55:19Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for line-bot-sdk-0.7.2

[back to package description]

line-bot-sdk Build Actions

Servant library for building LINE chatbots.

Features:

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

See the official API documentation for more information.

Usage

{-# LANGUAGE DataKinds         #-}
{-# LANGUAGE OverloadedStrings #-}

import           Data.String        (fromString)
import           Line.Bot.Client
import           Line.Bot.Types
import           System.Environment (getEnv)

getProfiles :: Id Room -> Line [Profile]
getProfiles roomId = do
  userIds <- getRoomMemberUserIds roomId
  sequence $ getRoomMemberProfile roomId <$> userIds

main = do
  token  <- fromString <$> getEnv "CHANNEL_TOKEN"
  result <- runLine (getProfiles "U4af4980629...") 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.