line 2.1.0.2 → 2.2.0
raw patch · 3 files changed
+20/−1 lines, 3 files
Files
- CHANGELOG.md +4/−0
- line.cabal +1/−1
- src/Line/Messaging/API.hs +15/−0
CHANGELOG.md view
@@ -1,3 +1,7 @@+## 2.2.0 (15 Jan 2017)++* Add multicast API support+ ## 2.1.0.2 (6 Dec 2016) * Doc and test fixes to use POST for webhooks
line.cabal view
@@ -1,5 +1,5 @@ name: line-version: 2.1.0.2+version: 2.2.0 synopsis: Haskell SDK for the LINE API homepage: https://github.com/noraesae/line license: BSD3
src/Line/Messaging/API.hs view
@@ -17,6 +17,7 @@ -- | Every API call returns its result with @'APIIO'@. About the usage of -- @'APIIO'@, please refer to the previous section. push,+ multicast, reply, getContent, getProfile,@@ -128,6 +129,20 @@ push id' ms = do let url = "https://api.line.me/v2/bot/message/push" _ <- post url $ object [ "to" .= id'+ , "messages" .= map toJSON ms+ ]+ return ()++-- | Send messages to multiple users at any time.+--+-- Messages cannot be sent to groups or rooms.+--+-- For more information, please refer to+-- <https://devdocs.line.me/en/#multicast its API reference>.+multicast :: [ID] -> [Message] -> APIIO ()+multicast ids ms = do+ let url = "https://api.line.me/v2/bot/message/multicast"+ _ <- post url $ object [ "to" .= map toJSON ids , "messages" .= map toJSON ms ] return ()