Skip to content

Commit

Permalink
Add some comments in Telegram.Bot.Simple.Reply
Browse files Browse the repository at this point in the history
  • Loading branch information
fizruk committed Jun 3, 2018
1 parent ce7d1f7 commit 4e79140
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Telegram/Bot/Simple/Reply.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ data ReplyMessage = ReplyMessage
instance IsString ReplyMessage where
fromString = toReplyMessage . fromString

-- | Create a 'ReplyMessage' with just some 'Text' message.
toReplyMessage :: Text -> ReplyMessage
toReplyMessage text = ReplyMessage text Nothing Nothing Nothing Nothing Nothing

Expand All @@ -44,6 +45,7 @@ replyMessageToSendMessageRequest someChatId ReplyMessage{..} = SendMessageReques
, sendMessageReplyMarkup = replyMessageReplyMarkup
}

-- | Reply in the current chat (if possible).
reply :: ReplyMessage -> BotM ()
reply rmsg = do
mchatId <- currentChatId
Expand All @@ -54,6 +56,7 @@ reply rmsg = do
Nothing -> do
liftIO $ putStrLn "No chat to reply to"

-- | Reply with a text.
replyText :: Text -> BotM ()
replyText = reply . toReplyMessage

0 comments on commit 4e79140

Please sign in to comment.