Copyright | (c) Alexandre Moreno 2019-2021 |
---|---|
License | BSD-3-Clause |
Maintainer | alexmorenocano@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type Line = ReaderT ChannelToken ClientM
- runLine :: NFData a => Line a -> ChannelToken -> IO (Either ClientError a)
- withLine :: Line a -> ChannelToken -> (Either ClientError a -> IO b) -> IO b
- withLineEnv :: (ClientEnv -> IO a) -> IO a
- getProfile :: Id 'User -> Line Profile
- getGroupMemberProfile :: Id 'Group -> Id 'User -> Line Profile
- leaveGroup :: Id 'Group -> Line NoContent
- getGroupMemberUserIds :: Id 'Group -> Line [Id 'User]
- getRoomMemberProfile :: Id 'Room -> Id 'User -> Line Profile
- leaveRoom :: Id 'Room -> Line NoContent
- getRoomMemberUserIds :: Id 'Room -> Line [Id 'User]
- replyMessage :: ReplyToken -> [Message] -> Line NoContent
- pushMessage :: Id a -> [Message] -> Line NoContent
- multicastMessage :: [Id 'User] -> [Message] -> Line NoContent
- broadcastMessage :: [Message] -> Line NoContent
- getContent :: MessageId -> Line ByteString
- getContentS :: MessageId -> Line (SourceIO ByteString)
- getPushMessageCount :: Day -> Line (Maybe Int)
- getReplyMessageCount :: Day -> Line (Maybe Int)
- getMulticastMessageCount :: Day -> Line (Maybe Int)
- getBroadcastMessageCount :: Day -> Line (Maybe Int)
- getMessageQuota :: Line Int
- issueLinkToken :: Id 'User -> Line LinkToken
- issueChannelToken :: ChannelId -> ChannelSecret -> ClientM ShortLivedChannelToken
- revokeChannelToken :: ChannelToken -> ClientM NoContent
- createRichMenu :: RichMenu -> Line RichMenuId
- deleteRichMenu :: RichMenuId -> Line NoContent
- getRichMenu :: RichMenuId -> Line RichMenu
- uploadRichMenuImageJpg :: RichMenuId -> ByteString -> Line NoContent
- getRichMenuList :: Line [(RichMenuId, RichMenu)]
- setDefaultRichMenu :: RichMenuId -> Line NoContent
Documentation
type Line = ReaderT ChannelToken ClientM Source #
Line
is the monad in which bot requests run. Contains the
OAuth access token for a channel
runLine :: NFData a => Line a -> ChannelToken -> IO (Either ClientError a) Source #
Executes a request in the LINE plaform with the given ChannelToken
withLine :: Line a -> ChannelToken -> (Either ClientError a -> IO b) -> IO b Source #
Execute a request with a streaming response in the LINE platform
withLineEnv :: (ClientEnv -> IO a) -> IO a Source #
Perform a request using LINE ClientEnv
withLineEnv $ \env -> runClientM comp env
Profile
Group
Room
Message
replyMessage :: ReplyToken -> [Message] -> Line NoContent Source #
getContent :: MessageId -> Line ByteString Source #
getContentS :: MessageId -> Line (SourceIO ByteString) Source #
This is an streaming version of getContent
meant to be used with coroutine
libraries like pipes
, conduits
, streaming
, etc. You need and instance
of FromSourceIO
, see e.g. servant-conduit
.
Example:
getContentC :: MessageId -> Line (ConduitT () ByteString IO ()) getContentC = fmap fromSourceIO . getContentS
Account Link
OAuth
Rich menus
createRichMenu :: RichMenu -> Line RichMenuId Source #
deleteRichMenu :: RichMenuId -> Line NoContent Source #
getRichMenu :: RichMenuId -> Line RichMenu Source #
getRichMenuList :: Line [(RichMenuId, RichMenu)] Source #