telegram-bot-simple 0.14.3 → 0.14.4
raw patch · 5 files changed
+20/−5 lines, 5 filesdep ~telegram-bot-apiPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: telegram-bot-api
API changes (from Hackage documentation)
Files
- CHANGELOG.md +6/−0
- README.md +2/−1
- src/Telegram/Bot/Simple/BotApp/Internal.hs +7/−2
- src/Telegram/Bot/Simple/Eff.hs +3/−0
- telegram-bot-simple.cabal +2/−2
CHANGELOG.md view
@@ -1,3 +1,9 @@+0.14.4 -- 2024-11-07+---++- Print failures from telegram-bot-api thrown in bot action handlers (see [#197](https://github.com/fizruk/telegram-bot-simple/pull/197)).+- Support `telegram-bot-api-.7.4.3`.+ 0.14.3 -- 2024-10-20 ---
README.md view
@@ -33,6 +33,7 @@ | 0.13 | 7.0 | | 0.14 | 7.3 | | 0.14.2 | 7.4 |-| 0.14.3 | 7.4.1 |+| 0.14.3 | 7.4.2 |+| 0.14.4 | 7.4.3 | _Nick_
src/Telegram/Bot/Simple/BotApp/Internal.hs view
@@ -109,7 +109,9 @@ (newModel, effects) -> do writeTVar botModelVar newModel return effects- mapM_ ((liftIO . issueAction botEnv update) <=< runBotM (BotContext botUser update)) effects+ let runBotAndIssueAction+ = (liftIO . issueAction botEnv update) <=< runBotM (BotContext botUser update)+ mapM_ runBotAndIssueAction effects -- | A job to wait for the next action and process it. processActionJob :: BotApp model action -> BotEnv model action -> ClientM ()@@ -122,7 +124,10 @@ :: BotApp model action -> BotEnv model action -> IO ThreadId processActionsIndefinitely botApp botEnv = do a <- asyncLink $ forever $ do- runClientM (processActionJob botApp botEnv) (botClientEnv botEnv)+ res <- runClientM (processActionJob botApp botEnv) (botClientEnv botEnv)+ case res of+ Left err -> print err+ Right _ -> return () return (asyncThreadId a) -- | Start 'Telegram.Update' polling for a bot.
src/Telegram/Bot/Simple/Eff.hs view
@@ -24,6 +24,9 @@ , botContextUpdate :: Maybe Telegram.Update } +-- | To retain control over errors coming from Telegram API in `BotM`,+-- consider using `liftIO . flip runClientM clientEnv` instead.+-- Issues generated by servant-client will be logged, response failure errors will be ignored. liftClientM :: ClientM a -> BotM a liftClientM = BotM . lift
telegram-bot-simple.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12 name: telegram-bot-simple-version: 0.14.3+version: 0.14.4 synopsis: Easy to use library for building Telegram bots. description: Please see the README on Github at <https://github.com/fizruk/telegram-bot-simple#readme> category: Web@@ -70,7 +70,7 @@ , split , stm , template-haskell- , telegram-bot-api >= 7.3.1+ , telegram-bot-api >= 7.4.3 , text , time , transformers