From cb8ad94ad032d0c4ebbcdf865c7823354b012ca5 Mon Sep 17 00:00:00 2001 From: Akshay Mankar Date: Fri, 27 Oct 2023 09:20:51 +0200 Subject: [PATCH] Send message to one more person --- berlin-scraper/app/Main.hs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/berlin-scraper/app/Main.hs b/berlin-scraper/app/Main.hs index 6d6f66d..5ac6eaa 100644 --- a/berlin-scraper/app/Main.hs +++ b/berlin-scraper/app/Main.hs @@ -225,11 +225,19 @@ notify offer = do offerLink = " offer.link <> "\" >Apply Here" offerBody = offerAddress <> "\n" <> offerRooms <> "\n" <> offerArea <> "\n" <> offerLink offerText = offerTitle <> "\n\n" <> offerBody - sendMsgReq = (defSendMessage (SomeChatId $ ChatId 952512153) offerText) {sendMessageParseMode = Just HTML} - res <- runTG sendMsgReq + sendMsgReq1 = (defSendMessage (SomeChatId $ ChatId 952512153) offerText) {sendMessageParseMode = Just HTML} + sendMsgReq2 = (defSendMessage (SomeChatId $ ChatId 116981707) offerText) {sendMessageParseMode = Just HTML} + res1 <- runTG sendMsgReq1 liftIO $ - if res.responseOk + if res1.responseOk then putStrLn "Notified successfully" else do putStrLn $ "Failed to notify the offer: " <> show offer - Text.putStrLn $ "Response: " <> Text.decodeUtf8 (LBS.toStrict $ Aeson.encode res) + Text.putStrLn $ "Response: " <> Text.decodeUtf8 (LBS.toStrict $ Aeson.encode res1) + res2 <- runTG sendMsgReq2 + liftIO $ + if res2.responseOk + then putStrLn "Notified successfully" + else do + putStrLn $ "Failed to notify the offer: " <> show offer + Text.putStrLn $ "Response: " <> Text.decodeUtf8 (LBS.toStrict $ Aeson.encode res2)