Copyright | (c) Alexandre Moreno 2019-2021 |
---|---|
License | BSD-3-Clause |
Maintainer | alexmorenocano@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type Webhook = LineReqBody '[JSON] Events :> Post '[JSON] NoContent
- webhook :: MonadIO m => (Event -> m a) -> Events -> m NoContent
- data LineReqBody (contentTypes :: [*]) (a :: *)
- module Line.Bot.Webhook.Events
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
(AllCTUnrender list a, HasServer api context, HasContextEntry context ChannelSecret) => HasServer (LineReqBody list a :> api :: Type) context Source # | |
Defined in Line.Bot.Webhook type ServerT (LineReqBody list a :> api) m # 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 # | |
Defined in Line.Bot.Webhook |
module Line.Bot.Webhook.Events