line-bot-sdk-0.7.2: Haskell SDK for LINE Messaging API
Copyright(c) Alexandre Moreno 2019-2021
LicenseBSD-3-Clause
Maintaineralexmorenocano@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Line.Bot.Webhook

Description

 
Synopsis

Documentation

type Webhook = LineReqBody '[JSON] Events :> Post '[JSON] NoContent Source #

This type alias just specifies how webhook requests should be handled

webhook :: MonadIO m => (Event -> m a) -> Events -> m NoContent Source #

Helper function that takes a handler to process Webhook events:

server :: Server Webhook
server = webhook $ \case
  EventMessage { message, replyToken } = handleMessage message replyToken
  _                                    = return ()

data LineReqBody (contentTypes :: [*]) (a :: *) Source #

A Servant combinator that extracts the request body as a value of type a and performs signature valiadation

Instances

Instances details
(AllCTUnrender list a, HasServer api context, HasContextEntry context ChannelSecret) => HasServer (LineReqBody list a :> api :: Type) context Source # 
Instance details

Defined in Line.Bot.Webhook

Associated Types

type ServerT (LineReqBody list a :> api) m #

Methods

route :: Proxy (LineReqBody list a :> api) -> Context context -> Delayed env (Server (LineReqBody list a :> api)) -> Router env #

hoistServerWithContext :: Proxy (LineReqBody list a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (LineReqBody list a :> api) m -> ServerT (LineReqBody list a :> api) n #

type ServerT (LineReqBody list a :> api :: Type) m Source # 
Instance details

Defined in Line.Bot.Webhook

type ServerT (LineReqBody list a :> api :: Type) m = a -> ServerT api m