Browse Source

Use custom bot lib version, use reply message

Nicolas Lenz 2 months ago
parent
commit
4bce123ad0
2 changed files with 7 additions and 2 deletions
  1. 3
    2
      src/Main.hs
  2. 4
    0
      stack.yaml

+ 3
- 2
src/Main.hs View File

@@ -49,7 +49,7 @@ main = do
49 49
             Telegram.defaultTelegramClientEnv (Telegram.Token token) >>= startBot_ (traceBotDefault $ bot config) where
50 50
         Left exception -> putStrLn $ prettyPrintParseException exception
51 51
 
52
+-- | How to handle Actions.
52 53
 handleAction :: Action -> Model -> Eff Action Model
53 54
 handleAction action model = case action of
54 55
     NoAction -> pure model
@@ -62,8 +62,8 @@ handleAction action model = case action of
62 62
     Execute cmd -> model <# do
63 63
         (header, output) <- liftIO $ execute cmd
64 64
         let r = SomeInlineKeyboardMarkup $ InlineKeyboardMarkup [[callbackButton "Refresh" (commandName cmd)]]
65
-        reply $ (toReplyMessage header) {replyMessageParseMode = Just Telegram.Markdown}
66
-        reply $ (toReplyMessage output) {replyMessageReplyMarkup = Just r}
65
+        headerMessage <- reply $ (toReplyMessage header) {replyMessageParseMode = Just Telegram.Markdown}
66
+        reply $ (toReplyMessage output) {replyMessageReplyMarkup = Just r, replyMessageReplyToMessageId = Just $ messageMessageId $ fromJust headerMessage}
67 67
         pure NoAction
68 68
     ExecuteReplace cmd -> model <# do
69 69
         (_, output) <- liftIO $ execute cmd

+ 4
- 0
stack.yaml View File

@@ -2,3 +2,7 @@ resolver: lts-12.24
2 2
 
3 3
 packages:
4 4
 - .
5
+
6
+extra-deps:
7
+- git: https://github.com/Eisfunke/telegram-bot-simple
8
+  commit: 561688d3a56a2368896bd4491b48a58769f296a5

Loading…
Cancel
Save