diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,23 @@
+0.4
+---
+
+- Add Payments methods (see [#93](https://github.com/fizruk/telegram-bot-simple/pull/93));
+- Add Passport methods (see [#90](https://github.com/fizruk/telegram-bot-simple/pull/90));
+- Resolve discrepancies with Bot API 5.5 (see [#87](https://github.com/fizruk/telegram-bot-simple/pull/87), [#88](https://github.com/fizruk/telegram-bot-simple/pull/88))
+- Make `startPolling` polymorphic (see [#86](https://github.com/fizruk/telegram-bot-simple/pull/86));
+- Add Updating messages methods (see [#85](https://github.com/fizruk/telegram-bot-simple/pull/85)) ;
+- Add missing methods (see [#83](https://github.com/fizruk/telegram-bot-simple/pull/83), [#84](https://github.com/fizruk/telegram-bot-simple/pull/84));
+- Add `GameBot` (see [#82](https://github.com/fizruk/telegram-bot-simple/pull/82), [#95](https://github.com/fizruk/telegram-bot-simple/pull/95));
+- Allow return different types in `BotM` (see [#79](https://github.com/fizruk/telegram-bot-simple/pull/79), [#98](https://github.com/fizruk/telegram-bot-simple/pull/98));
+- Fix `UserId` integer overflow (see [#78](https://github.com/fizruk/telegram-bot-simple/pull/78));
+- Upgrade `EchoBot` example with sticker replies (see [#77](https://github.com/fizruk/telegram-bot-simple/pull/77));
+- Refactor file uploads (see [#76](https://github.com/fizruk/telegram-bot-simple/pull/76));
+- Add Stickers methods (see [#72](https://github.com/fizruk/telegram-bot-simple/pull/72), [#73](https://github.com/fizruk/telegram-bot-simple/pull/73), [#74](https://github.com/fizruk/telegram-bot-simple/pull/74) and [#75](https://github.com/fizruk/telegram-bot-simple/pull/75));
+- Refactor `FileInfo` (see [#71](https://github.com/fizruk/telegram-bot-simple/pull/71));
+- Add Game methods (see [#70](https://github.com/fizruk/telegram-bot-simple/pull/70));
+- Fix `MessageId` integer overflow (see [#69](https://github.com/fizruk/telegram-bot-simple/pull/69));
+- Add missing types (see [#66](https://github.com/fizruk/telegram-bot-simple/pull/66), [#81](https://github.com/fizruk/telegram-bot-simple/pull/81));
+
 0.3.8
 ---
 
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -8,13 +8,14 @@
 
 Easy to use library for building Telegram bots in Haskell.
 
-_**Disclaimer:** this library is under development.
-It is usable for most stuff, but is still far from a stable release._
-
 ## LambdaConf 2018 workshop
 
 This library was featured in a [LambdaConf 2018 workshop](https://lambdaconf2018.dryfta.com/en/program-schedule/program/32/building-a-telegram-bot-in-haskell).
 The supplementary materials for the workshop is available at https://github.com/fizruk/lambdaconf-2018-workshop.
+
+## Examples
+
+See bot examples here: https://github.com/fizruk/telegram-bot-simple/tree/master/examples
 
 ## Contributing
 
diff --git a/examples/EchoBot.hs b/examples/EchoBot.hs
--- a/examples/EchoBot.hs
+++ b/examples/EchoBot.hs
@@ -7,15 +7,15 @@
 
 import           Telegram.Bot.API
 import           Telegram.Bot.Simple
-import           Telegram.Bot.Simple.UpdateParser (updateMessageText)
+import           Telegram.Bot.Simple.UpdateParser (updateMessageText, updateMessageSticker)
 import           Telegram.Bot.API.InlineMode.InlineQueryResult
 import           Telegram.Bot.API.InlineMode.InputMessageContent (defaultInputTextMessageContent)
 
 type Model = ()
 
 data Action
-  = NoOp
-  | InlineEcho InlineQueryId Text
+  = InlineEcho InlineQueryId Text
+  | StickerEcho InputFile ChatId
   | Echo Text
 
 echoBot :: BotApp Model Action
@@ -33,27 +33,42 @@
       let queryId = inlineQueryId query
       let msg =  inlineQueryQuery query
       Just $ InlineEcho queryId msg
+  | isJust $ updateMessageSticker update = do
+    fileId <- stickerFileId <$> updateMessageSticker update
+    chatId <- updateChatId update
+    pure $ StickerEcho (InputFileId fileId) chatId
   | otherwise = case updateMessageText update of
       Just text -> Just (Echo text)
       Nothing   -> Nothing
 
 handleAction :: Action -> Model -> Eff Action Model
 handleAction action model = case action of
-  NoOp -> pure model
   InlineEcho queryId msg -> model <# do
-    _ <- liftClientM (
-      answerInlineQuery (
-          AnswerInlineQueryRequest
-            queryId
-            [
-              InlineQueryResult InlineQueryResultArticle (InlineQueryResultId msg) (Just msg) (Just (defaultInputTextMessageContent msg))
-            ]
-        )
-      )
-    return NoOp
+    let result = InlineQueryResult InlineQueryResultArticle (InlineQueryResultId msg) (Just msg) (Just (defaultInputTextMessageContent msg)) Nothing
+        answerInlineQueryRequest = AnswerInlineQueryRequest
+          { answerInlineQueryRequestInlineQueryId = queryId
+          , answerInlineQueryRequestResults       = [result]
+          , answerInlineQueryCacheTime            = Nothing
+          , answerInlineQueryIsPersonal           = Nothing
+          , answerInlineQueryNextOffset           = Nothing
+          , answerInlineQuerySwitchPmText         = Nothing
+          , answerInlineQuerySwitchPmParameter    = Nothing
+          }
+    _ <- liftClientM (answerInlineQuery answerInlineQueryRequest)
+    return ()
+  StickerEcho file chat -> model <# do
+    _ <- liftClientM 
+      (sendSticker 
+        (SendStickerRequest 
+          (SomeChatId chat) 
+          file 
+          Nothing 
+          Nothing 
+          Nothing 
+          Nothing))
+    return ()
   Echo msg -> model <# do
-    replyText msg
-    return NoOp
+    pure msg -- or replyText msg
 
 run :: Token -> IO ()
 run token = do
diff --git a/examples/GameBot.hs b/examples/GameBot.hs
new file mode 100644
--- /dev/null
+++ b/examples/GameBot.hs
@@ -0,0 +1,636 @@
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE StrictData #-}
+{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE TypeApplications #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+module Main where
+
+import Control.Concurrent.STM
+import Control.Monad (void, forM_)
+import Control.Monad.IO.Class (liftIO)
+import Data.ByteString (ByteString)
+import Data.Char (isSpace)
+import Data.Coerce (coerce)
+import Data.Function ((&))
+import Data.Hashable (Hashable)
+import Data.HashSet (HashSet)
+import Data.HashMap.Strict (HashMap)
+import Data.Maybe (isJust)
+import Data.Text.Encoding (encodeUtf8)
+import Dhall hiding (maybe, void)
+import Network.HTTP.Types (hLocation)
+import Network.Wai.Handler.Warp (defaultSettings, runSettings, setInstallShutdownHandler, setPort)
+import Options.Applicative hiding (command, action)
+import Prettyprinter.Internal   (pretty)
+import Servant
+import Servant.HTML.Blaze
+import System.Random (randomIO)
+import Test.QuickCheck (generate, shuffle)
+import Text.Blaze.Html
+import Web.Internal.FormUrlEncoded (ToForm, FromForm)
+import Web.Cookie
+
+import qualified Data.HashMap.Strict as HashMap
+import qualified Data.HashSet as HashSet
+import qualified Data.Text as Text
+import qualified Data.Text.IO as Text
+import qualified Data.UUID as UUID
+import qualified Options.Applicative as Optparse (command)
+import qualified System.Posix.Signals as Sig
+import qualified Text.Blaze.Html5 as H
+import qualified Text.Blaze.Html5.Attributes as A
+
+import Telegram.Bot.API
+import Telegram.Bot.API.Games
+import Telegram.Bot.API.InlineMode.InlineQueryResult
+import Telegram.Bot.API.InlineMode.InputMessageContent
+import Telegram.Bot.Simple
+import Telegram.Bot.Simple.UpdateParser
+
+type Model = ()
+
+data Action
+  = NoOp
+  | AGame ChatId Text
+  | AInlineGame InlineQueryId Text
+  | AFeedback SomeChatId MessageId
+  | ACallback CallbackQuery
+
+gameBot :: BotSettings -> BotApp Model Action
+gameBot settings = BotApp
+  { botInitialModel = ()
+  , botAction = flip (updateToAction settings)
+  , botHandler = handleAction settings
+  , botJobs = []
+  }
+
+updateToAction :: BotSettings -> Model -> Update -> Maybe Action
+updateToAction BotSettings{..}  _ update
+  | isJust $ parseUpdate (command "game") update = game update
+  | isJust $ parseUpdate (command "feedback") update = do
+      msg <- updateMessage update
+      let msgId = messageMessageId msg
+          chat  = SomeChatId $ chatId $ messageChat msg
+      pure $ AFeedback chat msgId
+  | isJust $ updateInlineQuery update = do
+      query <- updateInlineQuery update
+      let queryId = inlineQueryId query
+          msg     = inlineQueryQuery query
+      Just $ AInlineGame queryId msg
+  | isJust $ updateCallbackQuery update = ACallback <$> updateCallbackQuery update
+  | otherwise = Nothing
+  where
+    game upd = AGame <$> (updateChatId upd) <*> (Just gameUrl)
+
+handleAction :: BotSettings -> Action -> Model -> Eff Action Model
+handleAction BotSettings{..} action model = case action of
+  NoOp -> pure model
+  AFeedback sourceChatId msgId -> model <# do
+    let shouldNotify  = Just True
+        targetChatId  = SomeChatId (ChatId (fromIntegral supportChatId))
+        fwdMsgRequest = ForwardMessageRequest targetChatId sourceChatId shouldNotify msgId
+    _ <- liftClientM (forwardMessage fwdMsgRequest)
+    return ()
+
+  AInlineGame queryId msg -> model <# do
+    let inlineQueryResult =
+          InlineQueryResult
+            InlineQueryResultGame
+            (InlineQueryResultId msg)
+            (Just msg)
+            (Just gameMsg)
+            Nothing
+        gameMsg = (defaultInputTextMessageContent gameMessageText) { inputMessageContentParseMode = Just "HTML" }
+        answerInlineQueryRequest = AnswerInlineQueryRequest
+          { answerInlineQueryRequestInlineQueryId = queryId
+          , answerInlineQueryRequestResults       = [inlineQueryResult]
+          , answerInlineQueryCacheTime            = Nothing
+          , answerInlineQueryIsPersonal           = Nothing
+          , answerInlineQueryNextOffset           = Nothing
+          , answerInlineQuerySwitchPmText         = Nothing
+          , answerInlineQuerySwitchPmParameter    = Nothing
+          }
+
+    _ <- liftClientM (answerInlineQuery answerInlineQueryRequest)
+    return ()
+  AGame targetChatId msg -> model <# do
+    let sendGameRequest = SendGameRequest
+          { sendGameRequestChatId                   = coerce targetChatId
+          , sendGameRequestGameShortName            = gameId
+          , sendGameRequestDisableNotification      = Nothing
+          , sendGameRequestReplyToMessageId         = Nothing
+          , sendGameRequestAllowSendingWithoutReply = Nothing
+          , sendGameRequestReplyMarkup              = Nothing
+          }
+    _ <- liftClientM $ sendGame sendGameRequest
+    return ()
+  ACallback callback -> model <# do
+    let queryId = coerce (callbackQueryId callback)
+        queryData = callbackQueryData callback
+        answerCallbackQueryRequest = AnswerCallbackQueryRequest
+          { answerCallbackQueryCallbackQueryId = queryId
+          , answerCallbackQueryText            = queryData
+          , answerCallbackQueryShowAlert       = Nothing
+          , answerCallbackQueryUrl             = Just gameUrl
+          , answerCallbackQueryCacheTime       = Nothing
+          }
+    _ <- liftClientM $ answerCallbackQuery answerCallbackQueryRequest
+    return ()
+    
+  where
+    gameMessageText = "<a href=\"" <> gameUrl <> "\">" <> gameName <> "</a>"
+data Command = CmdBot | CmdServer
+
+-- * Main
+
+main :: IO ()
+main = execParser (info (commands <**> helper) idm) >>= \case
+  CmdBot -> runTelegramBot
+  CmdServer -> runServer
+
+commands :: Parser Command
+commands = subparser
+    (Optparse.command "bot"    (info botOpts    (progDesc botDesc)) <>
+     Optparse.command "server" (info serverOpts (progDesc serverDesc)))
+  where
+    botDesc = "Run Telegram Game Bot"
+    serverDesc = "Run HTML5 Game Server"
+
+    botOpts = pure CmdBot
+    serverOpts = pure CmdServer
+
+-- * Bot
+
+runTelegramBot :: IO ()
+runTelegramBot = do
+  botSettings <- loadBotSettings
+  let token = Token (botToken botSettings)
+  env <- defaultTelegramClientEnv token
+  startBot_ (conversationBot updateChatId (gameBot botSettings)) env
+
+data BotSettings = BotSettings
+  { botToken      :: Text
+  , gameUrl       :: Text
+  , gameId        :: Text
+  , gameName      :: Text
+  , supportChatId :: Integer
+  }
+  deriving (Generic, FromDhall)
+
+loadBotSettings :: IO BotSettings
+loadBotSettings = input Dhall.auto "./examples/game-bot-settings.dhall"
+
+-- * Server
+
+runServer :: IO ()
+runServer = do
+  serverSettings <- loadServerSettings
+  env <- loadEnv serverSettings
+  let shutdownHandler closeSocket = void $ Sig.installHandler Sig.sigTERM handler Nothing
+        where
+          shutdownAction = storeEnv env
+          handler = Sig.Catch $ shutdownAction >> closeSocket
+      warpSettings = defaultSettings
+        & setPort port
+        & setInstallShutdownHandler shutdownHandler
+      port = fromIntegral (serverPort serverSettings)
+  runSettings warpSettings (serverApp env)
+
+data ServerSettings = ServerSettings
+  { serverPort       :: Natural
+  , serverUrlPrefix  :: Text
+  , questionsPerGame :: Natural
+  , usersPath        :: Text
+  , questionsPath    :: Text
+  , analyticsPath    :: Text
+  , pageStyle        :: Text
+  , quizDescription  :: Text
+  } deriving (Generic, FromDhall)
+
+serverSettingsPath :: Text
+serverSettingsPath = "./examples/game-server-settings.dhall"
+
+loadServerSettings :: IO ServerSettings
+loadServerSettings = input Dhall.auto serverSettingsPath
+
+data AnswerInt = AnswerInt { q :: Int } deriving (Eq, Show, Generic)
+
+instance ToForm AnswerInt
+
+instance FromForm AnswerInt
+
+type WithCookie x = Headers '[ Header "Set-Cookie" SetCookie ] x
+
+type API
+  =  Header "Cookie" Text
+  :> (     Get '[HTML] (WithCookie Html)
+     :<|> "game"  :>
+        (    Get '[HTML] (WithCookie Html)
+        :<|> ReqBody' '[Required, Strict] '[FormUrlEncoded] AnswerInt :> Post '[HTML] (WithCookie Html)
+        )
+     )
+
+api :: Proxy API
+api = Proxy
+
+server :: Env -> Server API
+server env = \cookie ->
+  (    startHandler env cookie
+  :<|> (firstQuestionHandler env cookie :<|> nextQuestionHandler env cookie)
+  )
+
+serverApp :: Env -> Application
+serverApp env = serve api (server env)
+
+-- *** Questions
+
+data Choice = Choice
+  { choiceText      :: Text
+  , choiceNumber    :: Integer
+  , choiceIsCorrect :: Bool
+  }
+  deriving (Eq, Show, Generic, Hashable, Ord, FromDhall, ToDhall)
+
+data Question
+  = QuestionBool
+      { questionBoolText         :: Text
+      , questionBoolAnswerIsTrue :: Bool
+      , questionBoolExplanation  :: Text
+      }
+  | QuestionChoice
+      { questionChoiceText        :: Text
+      , questionChoiceChoices     :: [Choice]
+      , questionChoiceExplanation :: Text
+      }
+  deriving (Eq, Show, Generic, Hashable, Ord, FromDhall, ToDhall)
+
+questionText :: Question -> Text
+questionText (QuestionBool txt _ _)  = txt
+questionText (QuestionChoice txt _ _) = txt
+
+questionExists :: Text -> HashSet Question -> Bool
+questionExists questionTxt = not . HashSet.null . HashSet.filter exists
+  where
+    exists (QuestionBool txt _isTrue _) = txt == questionTxt
+    exists (QuestionChoice txt _choices _) = txt == questionTxt
+
+explainError :: Question -> Text
+explainError QuestionBool{..} = questionBoolExplanation
+explainError QuestionChoice{..} = questionChoiceExplanation
+
+validateQuestion :: Question -> Bool
+validateQuestion (QuestionBool _ _ _) = True
+validateQuestion (QuestionChoice _ choices _) = checkConsistency choices
+  where
+    checkAnswerConsistency = (== 1) . length . filter choiceIsCorrect
+    checkIdConsistency x = (HashSet.size . HashSet.fromList . fmap choiceNumber) x == length x
+    checkConsistency x = checkIdConsistency x && checkAnswerConsistency x
+
+shuffleQuestions :: Int -> HashSet Question -> IO [Question]
+shuffleQuestions limit questions
+  = generate $ take limit <$> shuffle (HashSet.toList questions)
+
+solveQuestion :: Int -> Question -> Bool
+solveQuestion result QuestionBool{..} = intToBool result == questionBoolAnswerIsTrue
+  where
+    intToBool 0 = False
+    intToBool _ = True
+solveQuestion result QuestionChoice{..}
+  = not . null . filter (byNumber result) $ questionChoiceChoices
+  where
+    byNumber x Choice{..} = choiceNumber == fromIntegral x
+
+-- ** Answer
+
+data Answer = Answer
+  { answerQuestion           :: Question
+  , answerIsRight            :: Bool
+  , answerExplanationOnError :: Text
+  }
+  deriving (Eq, Show, Generic, FromDhall, ToDhall)
+
+registerAnswer :: Int -> Maybe Question -> [Answer] -> [Answer]
+registerAnswer userAnswer prevQuestion oldAnswers = case prevQuestion of
+  Nothing -> oldAnswers
+  Just q  -> newAnswer q : oldAnswers
+  where
+    newAnswer q = Answer q (solveQuestion userAnswer q) (explainError q)
+
+-- *** UserData
+
+newtype GameUserId = GameUserId Text
+  deriving (Eq, Show, Generic, Hashable, FromDhall, ToDhall)
+
+data UserData = UserData
+  { userDataCurrentQuestion :: Maybe Question
+  , userDataQuestions       :: [Question]
+  , userDataAnswers         :: [Answer]
+  , userDataTotalQuestions  :: Integer
+  }
+  deriving (Eq, Show, Generic, FromDhall, ToDhall)
+
+createUser :: Handler GameUserId
+createUser = liftIO (GameUserId . UUID.toText <$> randomIO)
+
+getOrCreateUser :: Maybe Text -> Handler GameUserId
+getOrCreateUser Nothing       = createUser
+getOrCreateUser (Just cookie) =
+  case parseUser cookie of
+    Nothing   -> createUser
+    Just user -> pure user
+
+parseUser :: Text -> Maybe GameUserId
+parseUser = fmap GameUserId
+  . HashMap.lookup "HUID"
+  . HashMap.fromList
+  . fmap (fmap (Text.drop 1) . Text.span (/= '='))
+  . Text.splitOn ";"
+  . Text.filter (not . isSpace)
+
+userToSetCookie :: GameUserId -> SetCookie
+userToSetCookie user = defaultSetCookie
+  { setCookieName = "HUID"
+  , setCookieValue = encodeUtf8 (coerce user)
+  }
+
+findUserData :: GameUserId -> HashMap GameUserId UserData -> Maybe UserData
+findUserData = HashMap.lookup
+
+initUserData :: [Question] -> Maybe UserData
+initUserData [] = Nothing
+initUserData total@(q : qs) = Just $ UserData
+  { userDataCurrentQuestion = Just q
+  , userDataQuestions       = qs
+  , userDataAnswers         = []
+  , userDataTotalQuestions  = fromIntegral $ length total
+  }
+
+alterUserData :: Int -> UserData -> GameState
+alterUserData userAnswer old = case (userDataCurrentQuestion old, userDataQuestions old) of
+  (Nothing, []) -> GameNotFound
+  (Just q, [])  -> GameOver $ old
+    { userDataCurrentQuestion = Just q
+    , userDataQuestions       = []
+    , userDataAnswers         =
+        registerAnswer userAnswer (userDataCurrentQuestion old) (userDataAnswers old)
+    }
+  (_, q : qs) -> GameInProgress $ old
+    { userDataCurrentQuestion = Just q
+    , userDataQuestions       = qs
+    , userDataAnswers         =
+        registerAnswer userAnswer (userDataCurrentQuestion old) (userDataAnswers old)
+    }
+
+gameDataFromState :: GameState -> Maybe UserData
+gameDataFromState = \case
+  GameNotFound -> Nothing
+  GameOver game -> Just game
+  GameInProgress game -> Just game
+
+data GameState = GameOver UserData | GameNotFound | GameInProgress UserData
+  deriving Eq
+
+-- *** Analytics
+
+data Analytics = Analytics
+  { rootPageCounter         :: Integer
+  , nextQuestionPageCounter :: Integer
+  }
+  deriving (Eq, Show, Generic, FromDhall, ToDhall)
+
+incrementRootPage :: Analytics -> Analytics
+incrementRootPage a = a { rootPageCounter = 1 + rootPageCounter a }
+
+incrementNextQuestionPage :: Analytics -> Analytics
+incrementNextQuestionPage a = a { nextQuestionPageCounter = 1 + nextQuestionPageCounter a }
+
+-- *** Env
+
+data Env = Env
+  { settings       :: ServerSettings
+  , userState      :: TVar (HashMap GameUserId UserData)
+  , questionsState :: TVar (HashSet Question)
+  , analytics      :: TVar Analytics
+  }
+
+loadEnv :: ServerSettings -> IO Env
+loadEnv settings@ServerSettings{..} = do
+  userState <- newTVarIO =<< loadUserState
+  questionsState <- newTVarIO =<< loadQuestionsState
+  analytics <- newTVarIO =<< loadAnalytics
+  pure Env{..}
+  where
+    loadUserState      = input Dhall.auto usersPath
+    loadQuestionsState = input Dhall.auto questionsPath
+    loadAnalytics      = input Dhall.auto analyticsPath
+
+storeEnv :: Env -> IO ()
+storeEnv Env{..} = do
+  let ServerSettings{..} = settings
+  storeState @(HashMap GameUserId UserData) usersPath userState
+  storeState @Analytics analyticsPath analytics
+  where
+    storeState :: forall a. ToDhall a => Text -> TVar a -> IO ()
+    storeState path state = do
+      stateData <- readTVarIO state
+      Text.writeFile (Text.unpack path) (renderDhall stateData)
+    renderDhall :: forall a. ToDhall a => a -> Text
+    renderDhall = Text.pack . show . pretty . Dhall.embed Dhall.inject
+
+-- *** Handlers
+
+withUser
+  :: Maybe Text
+  -> (GameUserId -> Handler (WithCookie Html))
+  -> Handler (WithCookie Html)
+withUser Nothing _action = redirectToRoot
+withUser (Just cookie) action = maybe redirectToRoot action (parseUser cookie)
+
+startHandler :: Env -> Maybe Text -> Handler (WithCookie Html)
+startHandler Env{..} mCookie = do
+  user <- getOrCreateUser mCookie
+  pure
+    $ addHeader @"Set-Cookie" (userToSetCookie user)
+    $ renderStartPage settings
+
+firstQuestionHandler :: Env -> Maybe Text -> Handler (WithCookie Html)
+firstQuestionHandler env mCookie = withUser mCookie (firstQuestionForUser env)
+  where
+    ServerSettings{..} = settings env
+    limit = fromIntegral questionsPerGame
+
+    firstQuestionForUser Env{..} user = do
+      mNewUserData <- liftIO $ do
+        newQuestions <- shuffleQuestions limit =<< readTVarIO questionsState
+        atomically $ do
+          modifyTVar' analytics incrementNextQuestionPage
+          let newUserData = initUserData newQuestions
+          case newUserData of
+            Nothing       -> pure ()
+            Just userData -> modifyTVar' userState $! HashMap.insert user userData
+          pure newUserData
+      case mNewUserData of
+        Nothing -> redirectToRoot
+        Just newUserData -> pure
+          $ addHeader @"Set-Cookie" (userToSetCookie user)
+          $ renderQuestionPage settings newUserData
+
+nextQuestionHandler :: Env -> Maybe Text -> AnswerInt -> Handler (WithCookie Html)
+nextQuestionHandler env mCookie (AnswerInt answer)
+  = withUser mCookie (nextQuestionForUser env answer)
+  where
+    nextQuestionForUser Env{..} numAnswer user = do
+      newGameState <- liftIO $ atomically $ do
+        modifyTVar' analytics incrementNextQuestionPage
+        oldUserState <- readTVar userState
+        case findUserData user oldUserState of
+          Nothing -> pure GameNotFound
+          Just oldUserData -> do
+            let newUserState = alterUserData numAnswer oldUserData
+            case gameDataFromState newUserState of
+              Nothing -> writeTVar userState $! HashMap.delete user oldUserState
+              Just newUserData ->
+                writeTVar userState $! HashMap.insert user newUserData oldUserState
+            pure newUserState
+      case newGameState of
+        GameNotFound -> redirectToStart user
+        GameOver oldUserData -> pure
+          $ addHeader @"Set-Cookie" (userToSetCookie user)
+          $ renderUserScore settings oldUserData
+        GameInProgress newUserData -> pure
+          $ addHeader @"Set-Cookie" (userToSetCookie user)
+          $ renderQuestionPage settings newUserData
+
+-- *** Redirects
+
+redirectToRoot :: Handler (WithCookie Html)
+redirectToRoot = noHeader @"Set-Cookie" <$> throwError (err301WithLoc "/")
+
+redirectToStart :: GameUserId -> Handler (WithCookie Html)
+redirectToStart user
+  =   addHeader @"Set-Cookie" (userToSetCookie user)
+  <$> throwError (err301WithLoc "/game")
+
+err301WithLoc :: ByteString -> ServerError
+err301WithLoc loc = err301 { errHeaders = [(hLocation, loc)] }
+
+-- *** Renderers
+
+makeAbsoluteUrl :: ServerSettings -> Text -> Text
+makeAbsoluteUrl ServerSettings{..} uri = serverUrlPrefix <> uri
+
+makeAbsoluteRootUrl :: ServerSettings -> Text
+makeAbsoluteRootUrl = flip makeAbsoluteUrl "/"
+
+makeAbsoluteGameUrl :: ServerSettings -> Text
+makeAbsoluteGameUrl = flip makeAbsoluteUrl "/game"
+
+withGameTemplate :: ServerSettings -> Html -> Html
+withGameTemplate ServerSettings{..} content = toHtml $ H.html $ do
+  H.head $ do
+    H.title $ "Game"
+    H.meta ! A.name "viewport" ! A.content "width=device-width, initial-scale=1"
+    H.style $ toMarkup pageStyle
+  H.body $ content
+
+renderText :: Text -> Html
+renderText txt =
+  H.div ! A.class_ "qbox pad" $ do
+    H.div ! A.class_ "qel" $ do
+      H.div ! A.class_ "text" $ toMarkup txt
+
+renderExplanation :: Bool -> Text -> Html
+renderExplanation True txt = renderText txt
+renderExplanation False txt = 
+  H.div ! A.class_ "qbox pad" $ do
+    H.div ! A.class_ "wel" $ do
+      H.div ! A.class_ "text" $ toMarkup txt
+
+renderButton :: Text -> Html
+renderButton txt = 
+  H.div ! A.class_ "qbox pad" $ do
+    H.button ! A.class_ "qel text button" ! A.type_ "submit"  ! A.value "submit" $ toMarkup txt
+
+renderAnswer :: Bool -> Int -> Text -> Html
+renderAnswer ch num txt =
+  H.div ! A.class_ "qbox pad" $ do
+    H.div ! A.class_ "qel" $ do
+      H.label ! A.class_ "container" ! A.for (toValue num) $ do
+        H.input
+          ! A.id (toValue num)
+          ! A.type_ "radio"
+          ! A.name "q"
+          !? (ch, A.checked "")
+          ! A.value (toValue num)
+        H.div ! A.class_ "checkmark" $ ""
+        H.div ! A.class_ "ctext text typing" $ toMarkup txt
+
+renderProgress :: Text -> Html
+renderProgress txt =
+  H.div ! A.class_ "qbox pad" $ do
+    H.div $ do
+      H.div ! A.class_ "text" $ toMarkup txt
+
+renderStartPage :: ServerSettings -> Html
+renderStartPage settings = withGameTemplate settings $ do
+  renderText "Haskell Quiz Game"
+  renderText (quizDescription settings)
+  H.form ! A.action (toValue $ makeAbsoluteGameUrl settings) ! A.method "get" $ do
+    renderButton "Play"
+
+renderQuestionPage :: ServerSettings -> UserData -> Html
+renderQuestionPage settings UserData{..} = withGameTemplate settings $ do
+  let progress = show (length userDataAnswers + 1) <> "/" <> show userDataTotalQuestions
+  case userDataCurrentQuestion of
+    Nothing -> do
+      renderText "No more questions left."
+      H.form ! A.action "/game" ! A.method "get" $ do
+        renderButton "Play again"
+
+    Just QuestionBool{..} -> do
+      renderText questionBoolText
+      H.form ! A.action (toValue $ makeAbsoluteGameUrl settings) ! A.method "post" $ do
+        renderAnswer True 1 "True"
+        renderAnswer False 0 "False"
+        renderButton "Next question"
+        renderProgress $ Text.pack progress
+
+    Just QuestionChoice{..} -> do
+      renderText questionChoiceText
+      H.form ! A.action (toValue $ makeAbsoluteGameUrl settings) ! A.method "post" $ do
+        forM_ questionChoiceChoices $
+          \Choice{..} -> renderAnswer
+            (if choiceNumber == 1 then True else False)
+            (fromIntegral choiceNumber)
+            choiceText
+        renderButton "Next question"
+        renderProgress $ Text.pack progress
+
+renderUserScore :: ServerSettings -> UserData -> Html
+renderUserScore settings UserData{..} = withGameTemplate settings $ do
+  case userDataAnswers of
+    [] -> do
+      renderText "Sorry. Looks like no answers available at the moment. Try again maybe?"
+      H.form ! A.action (toValue $ makeAbsoluteGameUrl settings) ! A.method "get" $ do
+        renderButton $ "Play again"
+    _  -> do
+      let total = show userDataTotalQuestions
+          current = show (length $ filter answerIsRight userDataAnswers)
+          score = Text.pack (current <> "/" <> total)
+      H.b $ do
+        renderText $ "Your score is: " <> score
+      H.div $ do
+        forM_ userDataAnswers $ \Answer{..} -> H.tr $ do
+          H.div $ renderText (questionText answerQuestion)
+          H.div $ if answerIsRight
+            then renderExplanation True "OK"
+            else renderExplanation False $ explainError answerQuestion
+      H.form ! A.action (toValue $ makeAbsoluteGameUrl settings) ! A.method "get" $ do
+        renderButton "Play again"
diff --git a/examples/TodoBot.hs b/examples/TodoBot.hs
new file mode 100644
--- /dev/null
+++ b/examples/TodoBot.hs
@@ -0,0 +1,129 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Main where
+
+import Control.Applicative
+import Data.Text (Text)
+import qualified Data.Text as Text
+import Data.HashMap.Strict (HashMap)
+import qualified Data.HashMap.Strict as HashMap
+
+import Telegram.Bot.API
+import Telegram.Bot.Simple
+import Telegram.Bot.Simple.UpdateParser
+
+type Item = Text
+
+data Model = Model
+  { todoLists   :: HashMap Text [Item]
+  , currentList :: Text
+  }
+
+defaultListName :: Text
+defaultListName = "Default"
+
+initialModel :: Model
+initialModel = Model
+  { todoLists = HashMap.fromList [(defaultListName, [])]
+  , currentList = defaultListName
+  }
+
+data Action
+  =  Start
+  | AddItem Item
+  | RemoveItem Item
+  | SwitchToList Text
+  | ShowAll
+  | Show Text
+  deriving (Show, Read)
+
+todoBot3 :: BotApp Model Action
+todoBot3 = BotApp
+  { botInitialModel = initialModel
+  , botAction = flip updateToAction
+  , botHandler = handleAction
+  , botJobs = []
+  }
+  where
+    updateToAction :: Model -> Update -> Maybe Action
+    updateToAction _ = parseUpdate $
+          AddItem      <$> plainText
+      <|> Start        <$  command "start"
+      <|> AddItem      <$> command "add"
+      <|> RemoveItem   <$> command "remove"
+      <|> SwitchToList <$> command "switch_to_list"
+      <|> Show         <$> command "show"
+      <|> ShowAll      <$  command "show_all"
+      <|> callbackQueryDataRead
+
+    handleAction :: Action -> Model -> Eff Action Model
+    handleAction action model = case action of
+      Start -> model <# do
+        reply (toReplyMessage startMessage)
+          { replyMessageReplyMarkup = Just (SomeReplyKeyboardMarkup startKeyboard) }
+      AddItem item -> addItem item model <# do
+        replyText "Ok, got it!"
+      RemoveItem item -> removeItem item model <# do
+        replyText "Item removed!"  
+      SwitchToList name -> model { currentList = name } <# do
+        replyText ("Switched to list «" <> name <> "»!") 
+      ShowAll -> model <# do
+        reply (toReplyMessage "Available todo lists")
+          { replyMessageReplyMarkup = Just (SomeInlineKeyboardMarkup listsKeyboard) }
+      Show "" -> model <# do
+        return (Show defaultListName)
+      Show name -> model <# do
+        let items = concat (HashMap.lookup name (todoLists model))
+        if null items
+          then reply (toReplyMessage ("The list «" <> name <> "» is empty. Maybe try these starter options?"))
+                 { replyMessageReplyMarkup = Just (SomeReplyKeyboardMarkup startKeyboard) }
+          else replyText (Text.unlines items)
+
+      where
+        listsKeyboard = InlineKeyboardMarkup
+          (map (\name -> [actionButton name (Show name)]) (HashMap.keys (todoLists model)))
+
+    startMessage = Text.unlines
+      [ "Hello! I am your personal TODO bot :)"
+      , ""
+      , "You can add new items to your todo list just by typing it!"
+      , "You can also use /add command to do that explicitely."
+      , "To remove an item use /remove command."
+      , ""
+      , "You can manage multiple todo lists:"
+      , "Switch to a new named list with /switch_to_list <list>."
+      , "Show all available lists with /show_all."
+      , "Show items for a specific list with /show <list>."
+      , ""
+      , "Here are some starter options, try adding something to the list."
+      ]
+
+    startKeyboard :: ReplyKeyboardMarkup
+    startKeyboard = ReplyKeyboardMarkup
+      { replyKeyboardMarkupKeyboard =
+          [ [ "Buy milk", "Get job done" ]
+          , [ "Build a house", "Plant a tree" ]
+          ]
+      , replyKeyboardMarkupResizeKeyboard = Just True
+      , replyKeyboardMarkupOneTimeKeyboard = Just True
+      , replyKeyboardMarkupSelective = Nothing
+      , replyKeyboardMarkupInputFieldSelector = Nothing
+      }
+
+addItem :: Item -> Model -> Model
+addItem item model = model
+  { todoLists = HashMap.insertWith (++) (currentList model) [item] (todoLists model) }
+
+removeItem :: Item -> Model -> Model
+removeItem item model = model
+  { todoLists = HashMap.adjust (filter (/= item)) (currentList model) (todoLists model)}
+
+run :: Token -> IO ()
+run token = do
+  env <- defaultTelegramClientEnv token
+  startBot_ (conversationBot updateChatId todoBot3) env
+
+main :: IO ()
+main = do
+  putStrLn "Please, enter Telegram bot's API token:"
+  token <- Token . Text.pack <$> getLine
+  run token
diff --git a/src/Telegram/Bot/API.hs b/src/Telegram/Bot/API.hs
--- a/src/Telegram/Bot/API.hs
+++ b/src/Telegram/Bot/API.hs
@@ -9,8 +9,8 @@
   module Telegram.Bot.API.Methods,
   -- * Updating messages
   module Telegram.Bot.API.UpdatingMessages,
---   -- * Stickers
---   module Telegram.Bot.API.Stickers,
+  -- * Stickers
+  module Telegram.Bot.API.Stickers,
   -- * Inline mode
   module Telegram.Bot.API.InlineMode,
 --   -- * Payments
@@ -24,7 +24,7 @@
 import           Telegram.Bot.API.Methods
 import           Telegram.Bot.API.Types
 import           Telegram.Bot.API.UpdatingMessages
--- import Telegram.Bot.API.Stickers
+import Telegram.Bot.API.Stickers
 import Telegram.Bot.API.InlineMode
 -- import Telegram.Bot.API.Payments
 -- import Telegram.Bot.API.Games
diff --git a/src/Telegram/Bot/API/Chat.hs b/src/Telegram/Bot/API/Chat.hs
--- a/src/Telegram/Bot/API/Chat.hs
+++ b/src/Telegram/Bot/API/Chat.hs
@@ -3,12 +3,10 @@
 {-# LANGUAGE TypeOperators #-}
 module Telegram.Bot.API.Chat where
 
-import Data.Coerce (coerce)
 import Data.Proxy
 import Servant.API
 import Servant.Client hiding (Response)
 
-import Telegram.Bot.API.Internal.Utils
 import Telegram.Bot.API.MakingRequests
 import Telegram.Bot.API.Types
 
diff --git a/src/Telegram/Bot/API/Games.hs b/src/Telegram/Bot/API/Games.hs
--- a/src/Telegram/Bot/API/Games.hs
+++ b/src/Telegram/Bot/API/Games.hs
@@ -1,1 +1,92 @@
+{-# LANGUAGE DataKinds                  #-}
+{-# LANGUAGE DeriveGeneric              #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE OverloadedStrings          #-}
+{-# LANGUAGE TemplateHaskell            #-}
+{-# LANGUAGE TypeApplications           #-}
+{-# LANGUAGE TypeOperators              #-}
 module Telegram.Bot.API.Games where
+
+import Data.Text (Text)
+import Data.Proxy
+import GHC.Generics (Generic)
+import Servant.API
+import Servant.Client hiding (Response)
+
+import Telegram.Bot.API.Internal.Utils (deriveJSON')
+import Telegram.Bot.API.MakingRequests (Response)
+import Telegram.Bot.API.Types (ChatId, GameHighScore, InlineKeyboardMarkup, Message, MessageId, UserId)
+
+-- * Types
+
+-- ** 'SendGameRequest'
+
+data SendGameRequest = SendGameRequest
+  { sendGameRequestChatId                   :: ChatId                     -- ^ Unique identifier for the target chat.
+  , sendGameRequestGameShortName            :: Text                       -- ^ Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
+  , sendGameRequestDisableNotification      :: Maybe Bool                 -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendGameRequestReplyToMessageId         :: Maybe MessageId            -- ^ If the message is a reply, ID of the original message.
+  , sendGameRequestAllowSendingWithoutReply :: Maybe Bool                 -- ^ Pass 'True', if the message should be sent even if the specified replied-to message is not found
+  , sendGameRequestReplyMarkup              :: Maybe InlineKeyboardMarkup -- ^ A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
+  }
+  deriving (Generic, Show)
+
+-- ** 'SetGameScoreRequest'
+
+data SetGameScoreRequest = SetGameScoreRequest
+  { setGameScoreRequestUserId             :: UserId          -- ^ User identifier.
+  , setGameScoreRequestScore              :: Integer         -- ^ New score, must be non-negative.
+  , setGameScoreRequestForce              :: Maybe Bool      -- ^ Pass 'True', if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters.
+  , setGameScoreRequestDisableEditMessage :: Maybe Bool      -- ^ Pass 'True', if the game message should not be automatically edited to include the current scoreboard.
+  , setGameScoreRequestChatId             :: Maybe ChatId    -- ^ Required if @inline_message_id@ is not specified. Unique identifier for the target chat
+  , setGameScoreRequestMessageId          :: Maybe MessageId -- ^ Required if @inline_message_id@ is not specified. Identifier of the sent message.
+  , setGameScoreRequestInlineMessageId    :: Maybe MessageId -- ^ Required if @chat_id@ and @message_id@ are not specified. Identifier of the inline message.
+  }
+  deriving (Generic, Show)
+
+-- ** 'SetGameScoreResult'
+
+data SetGameScoreResult = SetGameScoreMessage Message | SetGameScoreMessageBool Bool
+  deriving (Generic, Show)
+
+-- ** 'GetGameHighScoresRequest'
+
+data GetGameHighScoresRequest = GetGameHighScoresRequest
+  { getGameHighScoresRequestUserId          :: UserId          -- ^ Target user id.
+  , getGameHighScoresRequestChatId          :: Maybe ChatId    -- ^ Required if @inline_message_id@ is not specified. Unique identifier for the target chat.
+  , getGameHighScoresRequestMessageId       :: Maybe MessageId -- ^ Required if @inline_message_id@ is not specified. Identifier of the sent message.
+  , getGameHighScoresRequestInlineMessageId :: Maybe MessageId -- ^ Required if @chat_id@ and @message_id@ are not specified. Identifier of the inline message.
+  }
+  deriving (Generic, Show)
+
+-- * Methods
+
+-- ** 'sendGame'
+
+type SendGame
+  = "sendGame" :> ReqBody '[JSON] SendGameRequest :> Post '[JSON] (Response Message)
+
+-- | Use this method to send a game. On success, the sent 'Message' is returned.
+sendGame :: SendGameRequest -> ClientM (Response Message)
+sendGame = client (Proxy @SendGame)
+
+-- ** 'setGameScore'
+
+type SetGameScore
+  = "setGameScore" :> ReqBody '[JSON] SetGameScoreRequest :> Post '[JSON] (Response SetGameScoreResult)
+
+-- | Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the 'Message' is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
+setGameScore :: SetGameScoreRequest -> ClientM (Response SetGameScoreResult)
+setGameScore = client (Proxy @SetGameScore)
+
+-- ** 'getGameHighScores'
+
+type GetGameHighScores
+  = "getGameHighScores" :> ReqBody '[JSON] GetGameHighScoresRequest :> Post '[JSON] (Response [GameHighScore])
+
+
+foldMap deriveJSON'
+  [ ''SendGameRequest
+  , ''SetGameScoreRequest
+  , ''SetGameScoreResult
+  ]
diff --git a/src/Telegram/Bot/API/GettingUpdates.hs b/src/Telegram/Bot/API/GettingUpdates.hs
--- a/src/Telegram/Bot/API/GettingUpdates.hs
+++ b/src/Telegram/Bot/API/GettingUpdates.hs
@@ -35,12 +35,13 @@
   , updateEditedChannelPost :: Maybe Message -- ^ New version of a channel post that is known to the bot and was edited
 
   , updateInlineQuery :: Maybe InlineQuery -- ^ New incoming inline query
---   , updateChosenInlineResult :: Maybe ChosenInlineResult -- ^ The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.
 
+  , updateChosenInlineResult :: Maybe ChosenInlineResult -- ^ The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.
+
   , updateCallbackQuery     :: Maybe CallbackQuery -- ^ New incoming callback query
 
---   , updateShippingQuery :: Maybe ShippingQuery -- ^ New incoming shipping query. Only for invoices with flexible price
---   , updatePreCheckoutQuery :: Maybe PreCheckoutQuery -- ^ New incoming pre-checkout query. Contains full information about checkout
+  , updateShippingQuery     :: Maybe ShippingQuery -- ^ New incoming shipping query. Only for invoices with flexible price
+  , updatePreCheckoutQuery  :: Maybe PreCheckoutQuery -- ^ New incoming pre-checkout query. Contains full information about checkout
   } deriving (Generic, Show)
 
 instance ToJSON   Update where toJSON = gtoJSON
diff --git a/src/Telegram/Bot/API/InlineMode.hs b/src/Telegram/Bot/API/InlineMode.hs
--- a/src/Telegram/Bot/API/InlineMode.hs
+++ b/src/Telegram/Bot/API/InlineMode.hs
@@ -33,6 +33,7 @@
   , inlineQueryLocation :: Maybe Location -- ^ For bots that require user location, sender location
   , inlineQueryQuery    :: Text -- ^ Text of the query, up to 256 characters
   , inlineQueryOffset   :: Text -- ^ Offset of the results to be returned, can be controlled by bot
+  , inlineQueryChatType :: Maybe ChatType -- ^ Type of the chat, from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat.
   } deriving (Generic, Show)
 
 -- | Unique identifier for this query
@@ -50,11 +51,29 @@
 answerInlineQuery = client (Proxy @AnswerInlineQuery)
 
 data AnswerInlineQueryRequest = AnswerInlineQueryRequest
-  { answerInlineQueryRequestInlineQueryId :: InlineQueryId
-  , answerInlineQueryRequestResults       :: [InlineQueryResult]
+  { answerInlineQueryRequestInlineQueryId :: InlineQueryId       -- ^ Unique identifier for the answered query.
+  , answerInlineQueryRequestResults       :: [InlineQueryResult] -- ^ A JSON-serialized array of results for the inline query.
+  , answerInlineQueryCacheTime            :: Maybe Seconds       -- ^ The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
+  , answerInlineQueryIsPersonal           :: Maybe Bool          -- ^ Pass 'True', if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query.
+  , answerInlineQueryNextOffset           :: Maybe Text          -- ^ Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.
+  , answerInlineQuerySwitchPmText         :: Maybe Text          -- ^ If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter.
+  , answerInlineQuerySwitchPmParameter    :: Maybe Text          -- ^ Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.
+-- 
+-- Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.
   } deriving (Generic)
 
 instance ToJSON AnswerInlineQueryRequest where toJSON = gtoJSON
 instance FromJSON AnswerInlineQueryRequest where parseJSON = gparseJSON
+
+data ChosenInlineResult = ChosenInlineResult
+  { chosenInlineResultResultId        :: InlineQueryResultId -- ^ The unique identifier for the result that was chosen.
+  , chosenInlineResultFrom            :: User            -- ^ The user that chose the result.
+  , chosenInlineResultLocation        :: Maybe Location  -- ^ Sender location, only for bots that require user location.
+  , chosenInlineResultInlineMessageId :: Maybe MessageId -- ^ Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.
+  , chosenInlineResultQuery           :: InlineQueryId   -- ^ The query that was used to obtain the result.
+  } deriving (Generic, Show)
+
+instance ToJSON ChosenInlineResult where toJSON = gtoJSON
+instance FromJSON ChosenInlineResult where parseJSON = gparseJSON
 
 deriveJSON' ''InlineQuery
diff --git a/src/Telegram/Bot/API/InlineMode/InlineQueryResult.hs b/src/Telegram/Bot/API/InlineMode/InlineQueryResult.hs
--- a/src/Telegram/Bot/API/InlineMode/InlineQueryResult.hs
+++ b/src/Telegram/Bot/API/InlineMode/InlineQueryResult.hs
@@ -9,6 +9,7 @@
 import           GHC.Generics                    (Generic)
 
 import           Telegram.Bot.API.Internal.Utils
+import           Telegram.Bot.API.Types (Contact)
 import           Telegram.Bot.API.InlineMode.InputMessageContent
 
 -- | This object represents one result of an inline query
@@ -17,7 +18,7 @@
   , inlineQueryResultId :: InlineQueryResultId -- ^ Unique identifier for this result, 1-64 Bytes
   , inlineQueryResultTitle :: Maybe Text -- ^ Title of the result (only valid for "Article", "Photo", "Gif", "Mpeg4Gif", "Video", "Audio", "Voice", "Document", "Location", "Venue", "CachedPhoto", "CachedGif", "CachedMpeg4Gif", "CachedDocument", "CachedVideo", "CachedVoice" types of results)
   , inlineQueryResultInputMessageContent :: Maybe InputMessageContent
---  , inlineQueryResultContact  :: Maybe Contact
+  , inlineQueryResultContact  :: Maybe Contact
   } deriving (Generic, Show)
 
 newtype InlineQueryResultId = InlineQueryResultId Text
diff --git a/src/Telegram/Bot/API/Internal/Utils.hs b/src/Telegram/Bot/API/Internal/Utils.hs
--- a/src/Telegram/Bot/API/Internal/Utils.hs
+++ b/src/Telegram/Bot/API/Internal/Utils.hs
@@ -12,13 +12,20 @@
 import Control.Applicative ((<|>))
 import Data.Aeson (FromJSON(..), ToJSON(..), Value(..), GToJSON, GFromJSON, genericToJSON, genericParseJSON, Zero)
 import Data.Aeson.TH (deriveJSON)
-import Data.Aeson.Types (Options(..), defaultOptions, Parser)
+import Data.Aeson.Types (Options(..), defaultOptions, Parser, Pair)
 import Data.Char (isUpper, toUpper, toLower)
 import Data.List (intercalate)
 import GHC.Generics
 import Language.Haskell.TH
 import Control.Applicative (liftA2)
 
+#if MIN_VERSION_aeson(2,0,0)
+import qualified Data.Aeson.KeyMap as Map
+#else
+import qualified Data.HashMap.Strict as Map
+import Servant.Multipart (MultipartData(MultipartData), Input)
+#endif
+
 deriveJSON' :: Name -> Q [Dec]
 deriveJSON' name = deriveJSON (jsonOptions (nameBase name)) name
 
@@ -98,6 +105,14 @@
   gsomeParseJSON js
       = L1 <$> gsomeParseJSON js
     <|> R1 <$> gsomeParseJSON js
+
+addJsonFields :: Value -> [Pair] -> Value
+addJsonFields (Object obj) pairs = Object $  Map.union obj (Map.fromList pairs)
+addJsonFields x _ = x
+
+addMultipartFields :: [Input] -> MultipartData tag -> MultipartData tag
+addMultipartFields newFields (MultipartData currenFields files)
+      = MultipartData (newFields <> currenFields) files
 
 -- Instance Monoid for TH of ghc < 8.6
 #if !MIN_VERSION_template_haskell(2,17,0)
diff --git a/src/Telegram/Bot/API/MakingRequests.hs b/src/Telegram/Bot/API/MakingRequests.hs
--- a/src/Telegram/Bot/API/MakingRequests.hs
+++ b/src/Telegram/Bot/API/MakingRequests.hs
@@ -1,10 +1,16 @@
 {-# LANGUAGE DeriveGeneric              #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE OverloadedStrings          #-}
 module Telegram.Bot.API.MakingRequests where
 
 import           Data.Aeson                      (FromJSON (..), ToJSON (..))
+#if defined(MIN_VERSION_GLASGOW_HASKELL)
+#if MIN_VERSION_GLASGOW_HASKELL(8,6,2,0)
+#else
 import           Data.Monoid                     ((<>))
+#endif
+#endif
 import           Data.String                     (IsString)
 import           Data.Text                       (Text)
 import qualified Data.Text                       as Text
diff --git a/src/Telegram/Bot/API/Methods.hs b/src/Telegram/Bot/API/Methods.hs
--- a/src/Telegram/Bot/API/Methods.hs
+++ b/src/Telegram/Bot/API/Methods.hs
@@ -5,288 +5,1613 @@
 {-# LANGUAGE RecordWildCards #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE TypeOperators #-}
-module Telegram.Bot.API.Methods where
-
-import Control.Monad.IO.Class
-import Data.Aeson
-import Data.Aeson.Text
-import Data.Bool
-import Data.Proxy
-import Data.Text (Text)
-import qualified Data.Text as T
-import qualified Data.Text.Lazy as TL
-import GHC.Generics (Generic)
-import Servant.API
-import Servant.Client hiding (Response)
-import Servant.Multipart
-import Servant.Multipart.Client
-import System.FilePath
-
-import Telegram.Bot.API.Internal.Utils
-import Telegram.Bot.API.MakingRequests
-import Telegram.Bot.API.Types
-
--- * Available methods
-
--- ** 'getMe'
-
-type GetMe = "getMe" :> Get '[JSON] (Response User)
-
--- | A simple method for testing your bot's auth token.
--- Requires no parameters.
--- Returns basic information about the bot in form of a 'User' object.
-getMe :: ClientM (Response User)
-getMe = client (Proxy @GetMe)
-
--- ** 'deleteMessage'
-
--- | Notice that deleting by POST method was bugged, so we use GET
-type DeleteMessage = "deleteMessage"
-  :> RequiredQueryParam "chat_id" ChatId
-  :> RequiredQueryParam "message_id" MessageId
-  :> Get '[JSON] (Response Bool)
-
--- | Use this method to delete message in chat.
--- On success, the sent Bool is returned.
-deleteMessage :: ChatId -> MessageId -> ClientM (Response Bool)
-deleteMessage = client (Proxy @DeleteMessage)
-
--- ** 'sendMessage'
-
-type SendMessage
-  = "sendMessage" :> ReqBody '[JSON] SendMessageRequest :> Post '[JSON] (Response Message)
-
--- | Use this method to send text messages.
--- On success, the sent 'Message' is returned.
-sendMessage :: SendMessageRequest -> ClientM (Response Message)
-sendMessage = client (Proxy @SendMessage)
-
--- ** 'forwardMessage'
-type ForwardMessage
-  = "forwardMessage" :> ReqBody '[JSON] ForwardMessageRequest :> Post '[JSON] (Response Message)
-
--- | Use this method to forward messages of any kind.
--- On success, the sent 'Message' is returned.
-
-forwardMessage :: ForwardMessageRequest -> ClientM (Response Message)
-forwardMessage = client (Proxy @ForwardMessage)
-
--- | Unique identifier for the target chat
--- or username of the target channel (in the format @\@channelusername@).
-data SomeChatId
-  = SomeChatId ChatId       -- ^ Unique chat ID.
-  | SomeChatUsername Text   -- ^ Username of the target channel.
-  deriving (Generic)
-
-instance ToJSON   SomeChatId where toJSON = genericSomeToJSON
-instance FromJSON SomeChatId where parseJSON = genericSomeParseJSON
-
--- | Additional interface options.
--- A JSON-serialized object for an inline keyboard, custom reply keyboard,
--- instructions to remove reply keyboard or to force a reply from the user.
-data SomeReplyMarkup
-  = SomeInlineKeyboardMarkup InlineKeyboardMarkup
-  | SomeReplyKeyboardMarkup  ReplyKeyboardMarkup
-  | SomeReplyKeyboardRemove  ReplyKeyboardRemove
-  | SomeForceReply           ForceReply
-  deriving (Generic)
-
-instance ToJSON   SomeReplyMarkup where toJSON = genericSomeToJSON
-instance FromJSON SomeReplyMarkup where parseJSON = genericSomeParseJSON
-
-data ParseMode
-  = Markdown
-  | HTML
-  | MarkdownV2
-  deriving (Generic)
-
-instance ToJSON   ParseMode
-instance FromJSON ParseMode
-
--- | Request parameters for 'sendMessage'.
-data SendMessageRequest = SendMessageRequest
-  { sendMessageChatId                :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).
-  , sendMessageText                  :: Text -- ^ Text of the message to be sent.
-  , sendMessageParseMode             :: Maybe ParseMode -- ^ Send 'Markdown' or 'HTML', if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
-  , sendMessageDisableWebPagePreview :: Maybe Bool -- ^ Disables link previews for links in this message.
-  , sendMessageDisableNotification   :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
-  , sendMessageReplyToMessageId      :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
-  , sendMessageReplyMarkup           :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
-  } deriving (Generic)
-
-instance ToJSON   SendMessageRequest where toJSON = gtoJSON
-instance FromJSON SendMessageRequest where parseJSON = gparseJSON
-
--- | Request parameters for 'forwardMessage'.
-data ForwardMessageRequest = ForwardMessageRequest
-  { forwardMessageChatId              :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @\@channelusername).
-  , forwardMessageFromChatId          :: SomeChatId -- ^ Unique identifier for the chat where the original message was sent (or channel username in the format @\@channelusername)
-  , forwardMessageDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
-  , forwardMessageMessageId           :: MessageId -- ^ Message identifier in the chat specified in from_chat_id
-  } deriving (Generic)
-
-instance ToJSON   ForwardMessageRequest where toJSON = gtoJSON
-instance FromJSON ForwardMessageRequest where parseJSON = gparseJSON
-
--- ** 'sendMessage'
-type SendDocumentContent
-  = "sendDocument"
-  :> MultipartForm Tmp SendDocumentRequest
-  :> Post '[JSON] (Response Message)
-
-type SendDocumentLink
-  = "sendDocument"
-  :> ReqBody '[JSON] SendDocumentRequest
-  :> Post '[JSON] (Response Message)
-
--- | Use this method to send text messages.
--- On success, the sent 'Message' is returned.
---
--- <https:\/\/core.telegram.org\/bots\/api#senddocument>
-sendDocument :: SendDocumentRequest -> ClientM (Response Message)
-sendDocument r = do
-  case sendDocumentDocument r of
-    DocumentFile{} -> do
-      boundary <- liftIO genBoundary
-      client (Proxy @SendDocumentContent) (boundary, r)
-    _ -> client (Proxy @SendDocumentLink) r
-
--- | Request parameters for 'sendDocument'
-data SendDocumentRequest = SendDocumentRequest
-  { sendDocumentChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).
-  , sendDocumentDocument :: DocumentFile -- ^ Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data
-  , sendDocumentThumb :: Maybe FilePath -- ^ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
-  , sendDocumentCaption :: Maybe Text -- ^ Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
-  , sendDocumentParseMode :: Maybe ParseMode -- ^ Mode for parsing entities in the document caption.
-  , sendDocumentDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
-  , sendDocumentReplyToMessageId :: Maybe MessageId
-  , sendDocumentReplyMarkup :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
-  }
-  deriving Generic
-
-data DocumentFile
-  = DocumentFileId Int
-  | DocumentUrl Text
-  | DocumentFile FilePath ContentType
-
-instance ToJSON DocumentFile where
-  toJSON (DocumentFileId i) = toJSON (show i)
-  toJSON (DocumentUrl t) = toJSON t
-  toJSON (DocumentFile f _) = toJSON ("attach://" <> T.pack (takeFileName f))
-
-type ContentType = Text
-
-instance ToMultipart Tmp SendDocumentRequest where
-  toMultipart SendDocumentRequest{..} = MultipartData fields files where
-    fields = 
-      [ Input "document" $ T.pack $ "attach://file"
-      , Input "chat_id" $ case sendDocumentChatId of
-          SomeChatId (ChatId chat_id) -> T.pack $ show chat_id
-          SomeChatUsername txt -> txt
-      ] <> 
-      (   (maybe id (\_ -> ((Input "thumb" "attach://thumb"):)) sendDocumentThumb)
-        $ (maybe id (\t -> ((Input "caption" t):)) sendDocumentCaption)
-        $ (maybe id (\t -> ((Input "parse_mode" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentParseMode)
-        $ (maybe id (\t -> ((Input "disable_notification" (bool "false" "true" t)):)) sendDocumentDisableNotification)
-        $ (maybe id (\t -> ((Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentReplyToMessageId)
-        $ (maybe id (\t -> ((Input "reply_markup" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentReplyMarkup)
-        [])
-    files 
-      = (FileData "file" (T.pack $ takeFileName path) ct path)
-      : maybe [] (\t -> [FileData "thumb" (T.pack $ takeFileName t) "image/jpeg" t]) sendDocumentThumb
-
-    DocumentFile path ct = sendDocumentDocument
-    
-
-instance ToJSON   SendDocumentRequest where toJSON = gtoJSON
-
--- | Generate send document structure.
-toSendDocument :: SomeChatId -> DocumentFile -> SendDocumentRequest
-toSendDocument ch df = SendDocumentRequest
-  { sendDocumentChatId = ch
-  , sendDocumentDocument = df
-  , sendDocumentThumb = Nothing
-  , sendDocumentCaption = Nothing
-  , sendDocumentParseMode = Nothing
-  , sendDocumentDisableNotification = Nothing
-  , sendDocumentReplyToMessageId = Nothing
-  , sendDocumentReplyMarkup = Nothing
-  }
-
--- ** 'getFile'
-type GetFile
-  = "getFile"
-  :> RequiredQueryParam "file_id" FileId
-  :> Get '[JSON] (Response File)
-
-getFile :: FileId -> ClientM (Response File)
-getFile = client (Proxy @GetFile)
-
--- ** 'sendPhoto'
-type SendPhotoContent
-  = "sendPhoto"
-  :> MultipartForm Tmp SendPhotoRequest
-  :> Post '[JSON] (Response Message)
-
-type SendPhotoLink
-  = "sendPhoto"
-  :> ReqBody '[JSON] SendPhotoRequest
-  :> Post '[JSON] (Response Message)
-
-data PhotoFile
-  = PhotoFileId Int
-  | PhotoUrl Text
-  | PhotoFile FilePath ContentType
-
-instance ToJSON PhotoFile where
-  toJSON (PhotoFileId i) = toJSON (show i)
-  toJSON (PhotoUrl t) = toJSON t
-  toJSON (PhotoFile f _) = toJSON ("attach://" <> T.pack (takeFileName f))
-
--- | Request parameters for 'sendPhoto'
-data SendPhotoRequest = SendPhotoRequest
-  { sendPhotoChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).
-  , sendPhotoPhoto :: PhotoFile -- ^ Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data
-  , sendPhotoThumb :: Maybe FilePath -- ^ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
-  , sendPhotoCaption :: Maybe Text -- ^ Photo caption (may also be used when resending Photos by file_id), 0-1024 characters after entities parsing
-  , sendPhotoParseMode :: Maybe ParseMode -- ^ Mode for parsing entities in the Photo caption.
-  , sendPhotoDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
-  , sendPhotoReplyToMessageId :: Maybe MessageId
-  , sendPhotoReplyMarkup :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
-  }
-  deriving Generic
-
-instance ToMultipart Tmp SendPhotoRequest where
-  toMultipart SendPhotoRequest{..} = MultipartData fields files where
-    fields =
-      [ Input "photo" $ T.pack $ "attach://file"
-      , Input "chat_id" $ case sendPhotoChatId of
-          SomeChatId (ChatId chat_id) -> T.pack $ show chat_id
-          SomeChatUsername txt -> txt
-      ] <>
-      (   (maybe id (\_ -> ((Input "thumb" "attach://thumb"):)) sendPhotoThumb)
-        $ (maybe id (\t -> ((Input "caption" t):)) sendPhotoCaption)
-        $ (maybe id (\t -> ((Input "parse_mode" (TL.toStrict $ encodeToLazyText t)):)) sendPhotoParseMode)
-        $ (maybe id (\t -> ((Input "disable_notification" (bool "false" "true" t)):)) sendPhotoDisableNotification)
-        $ (maybe id (\t -> ((Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)):)) sendPhotoReplyToMessageId)
-        $ (maybe id (\t -> ((Input "reply_markup" (TL.toStrict $ encodeToLazyText t)):)) sendPhotoReplyMarkup)
-        [])
-    files
-      = (FileData "file" (T.pack $ takeFileName path) ct path)
-      : maybe [] (\t -> [FileData "thumb" (T.pack $ takeFileName t) "image/jpeg" t]) sendPhotoThumb
-
-    PhotoFile path ct = sendPhotoPhoto
-
-instance ToJSON SendPhotoRequest where toJSON = gtoJSON
-
--- | Use this method to send photos.
--- On success, the sent 'Message' is returned.
---
--- <https:\/\/core.telegram.org\/bots\/api#sendphoto>
-sendPhoto :: SendPhotoRequest -> ClientM (Response Message)
-sendPhoto r = do
-  case sendPhotoPhoto r of
-    PhotoFile{} -> do
-      boundary <- liftIO genBoundary
-      client (Proxy @SendPhotoContent) (boundary, r)
-    _ -> client (Proxy @SendPhotoLink) r
+{-# LANGUAGE DerivingStrategies #-}
+{-# LANGUAGE PatternSynonyms #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE TemplateHaskell #-}
+module Telegram.Bot.API.Methods where
+
+import Control.Monad.IO.Class
+import Data.Aeson
+import Data.Aeson.Text
+import Data.Bool
+import Data.Proxy
+import Data.Text (Text)
+import qualified Data.Text as T
+import qualified Data.Text.Lazy as TL
+import GHC.Generics (Generic)
+import Servant.API
+import Servant.Client hiding (Response)
+import Servant.Multipart
+import Servant.Multipart.Client
+import System.FilePath
+
+import Telegram.Bot.API.Internal.Utils
+import Telegram.Bot.API.MakingRequests
+import Telegram.Bot.API.Types
+import Data.Maybe (catMaybes)
+import Data.Functor ((<&>))
+
+-- * Available methods
+
+-- ** 'getMe'
+
+type GetMe = "getMe" :> Get '[JSON] (Response User)
+
+-- | A simple method for testing your bot's auth token.
+-- Requires no parameters.
+-- Returns basic information about the bot in form of a 'User' object.
+getMe :: ClientM (Response User)
+getMe = client (Proxy @GetMe)
+
+-- ** 'deleteMessage'
+
+-- | Notice that deleting by POST method was bugged, so we use GET
+type DeleteMessage = "deleteMessage"
+  :> RequiredQueryParam "chat_id" ChatId
+  :> RequiredQueryParam "message_id" MessageId
+  :> Get '[JSON] (Response Bool)
+
+-- | Use this method to delete message in chat.
+-- On success, the sent Bool is returned.
+deleteMessage :: ChatId -> MessageId -> ClientM (Response Bool)
+deleteMessage = client (Proxy @DeleteMessage)
+
+-- ** 'sendMessage'
+
+type SendMessage
+  = "sendMessage" :> ReqBody '[JSON] SendMessageRequest :> Post '[JSON] (Response Message)
+
+-- | Use this method to send text messages.
+-- On success, the sent 'Message' is returned.
+sendMessage :: SendMessageRequest -> ClientM (Response Message)
+sendMessage = client (Proxy @SendMessage)
+
+-- ** 'forwardMessage'
+type ForwardMessage
+  = "forwardMessage" :> ReqBody '[JSON] ForwardMessageRequest :> Post '[JSON] (Response Message)
+
+-- | Use this method to forward messages of any kind.
+-- On success, the sent 'Message' is returned.
+
+forwardMessage :: ForwardMessageRequest -> ClientM (Response Message)
+forwardMessage = client (Proxy @ForwardMessage)
+
+-- | Additional interface options.
+-- A JSON-serialized object for an inline keyboard, custom reply keyboard,
+-- instructions to remove reply keyboard or to force a reply from the user.
+data SomeReplyMarkup
+  = SomeInlineKeyboardMarkup InlineKeyboardMarkup
+  | SomeReplyKeyboardMarkup  ReplyKeyboardMarkup
+  | SomeReplyKeyboardRemove  ReplyKeyboardRemove
+  | SomeForceReply           ForceReply
+  deriving (Generic)
+
+instance ToJSON   SomeReplyMarkup where toJSON = genericSomeToJSON
+instance FromJSON SomeReplyMarkup where parseJSON = genericSomeParseJSON
+
+data ParseMode
+  = Markdown
+  | HTML
+  | MarkdownV2
+  deriving (Generic)
+
+instance ToJSON   ParseMode
+instance FromJSON ParseMode
+
+-- | Request parameters for 'sendMessage'.
+data SendMessageRequest = SendMessageRequest
+  { sendMessageChatId                :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).
+  , sendMessageText                  :: Text -- ^ Text of the message to be sent.
+  , sendMessageParseMode             :: Maybe ParseMode -- ^ Send 'Markdown' or 'HTML', if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
+  , sendMessageEntities              :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in message text, which can be specified instead of /parse_mode/.
+  , sendMessageDisableWebPagePreview :: Maybe Bool -- ^ Disables link previews for links in this message.
+  , sendMessageDisableNotification   :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendMessageReplyToMessageId      :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
+  , sendMessageAllowSendingWithoutReply :: Maybe Bool -- ^ Pass 'True', if the message should be sent even if the specified replied-to message is not found.
+  , sendMessageReplyMarkup           :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  } deriving (Generic)
+
+instance ToJSON   SendMessageRequest where toJSON = gtoJSON
+instance FromJSON SendMessageRequest where parseJSON = gparseJSON
+
+-- | Request parameters for 'forwardMessage'.
+data ForwardMessageRequest = ForwardMessageRequest
+  { forwardMessageChatId              :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @\@channelusername).
+  , forwardMessageFromChatId          :: SomeChatId -- ^ Unique identifier for the chat where the original message was sent (or channel username in the format @\@channelusername)
+  , forwardMessageDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , forwardMessageMessageId           :: MessageId -- ^ Message identifier in the chat specified in from_chat_id
+  } deriving (Generic)
+
+instance ToJSON   ForwardMessageRequest where toJSON = gtoJSON
+instance FromJSON ForwardMessageRequest where parseJSON = gparseJSON
+
+-- ** 'sendMessage'
+type SendDocumentContent
+  = "sendDocument"
+  :> MultipartForm Tmp SendDocumentRequest
+  :> Post '[JSON] (Response Message)
+
+type SendDocumentLink
+  = "sendDocument"
+  :> ReqBody '[JSON] SendDocumentRequest
+  :> Post '[JSON] (Response Message)
+
+-- | Use this method to send text messages.
+-- On success, the sent 'Message' is returned.
+--
+-- <https:\/\/core.telegram.org\/bots\/api#senddocument>
+sendDocument :: SendDocumentRequest -> ClientM (Response Message)
+sendDocument r = do
+  case sendDocumentDocument r of
+    DocumentFile{} -> do
+      boundary <- liftIO genBoundary
+      client (Proxy @SendDocumentContent) (boundary, r)
+    _ -> client (Proxy @SendDocumentLink) r
+
+-- | Request parameters for 'sendDocument'
+data SendDocumentRequest = SendDocumentRequest
+  { sendDocumentChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).
+  , sendDocumentDocument :: DocumentFile -- ^ Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data
+  , sendDocumentThumb :: Maybe FilePath -- ^ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
+  , sendDocumentCaption :: Maybe Text -- ^ Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
+  , sendDocumentParseMode :: Maybe ParseMode -- ^ Mode for parsing entities in the document caption.
+  , sendDocumentCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of /parse_mode/.
+  , sendDocumentDisableContentTypeDetection :: Maybe Bool -- ^ Disables automatic server-side content type detection for files uploaded using @multipart/form-data@.
+  , sendDocumentDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendDocumentReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
+  , sendDocumentAllowSendingWithoutReply :: Maybe Bool -- ^ Pass 'True', if the message should be sent even if the specified replied-to message is not found.
+  , sendDocumentReplyMarkup :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+
+newtype DocumentFile = MakeDocumentFile InputFile
+  deriving newtype ToJSON
+
+pattern DocumentFileId :: FileId -> DocumentFile
+pattern DocumentFileId x = MakeDocumentFile (InputFileId x)
+
+pattern DocumentUrl :: Text -> DocumentFile
+pattern DocumentUrl x = MakeDocumentFile (FileUrl x)
+
+pattern DocumentFile :: FilePath -> ContentType -> DocumentFile
+pattern DocumentFile x y = MakeDocumentFile (InputFile x y)
+
+
+instance ToMultipart Tmp SendDocumentRequest where
+  toMultipart SendDocumentRequest{..} = MultipartData fields files where
+    fields =
+      [ Input "document" $ T.pack $ "attach://file"
+      , Input "chat_id" $ case sendDocumentChatId of
+          SomeChatId (ChatId chat_id) -> T.pack $ show chat_id
+          SomeChatUsername txt -> txt
+      ] <>
+      (   (maybe id (\_ -> ((Input "thumb" "attach://thumb"):)) sendDocumentThumb)
+        $ (maybe id (\t -> ((Input "caption" t):)) sendDocumentCaption)
+        $ (maybe id (\t -> ((Input "parse_mode" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentParseMode)
+        $ (maybe id (\t -> ((Input "caption_entities" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentCaptionEntities)
+        $ (maybe id (\t -> ((Input "disable_notification" (bool "false" "true" t)):)) sendDocumentDisableNotification)
+        $ (maybe id (\t -> ((Input "disable_content_type_detection" (bool "false" "true" t)):)) sendDocumentDisableContentTypeDetection)
+        $ (maybe id (\t -> ((Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentReplyToMessageId)
+        $ (maybe id (\t -> ((Input "allow_sending_without_reply" (bool "false" "true" t)):)) sendDocumentAllowSendingWithoutReply)
+        $ (maybe id (\t -> ((Input "reply_markup" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentReplyMarkup)
+        [])
+    files
+      = (FileData "file" (T.pack $ takeFileName path) ct path)
+      : maybe [] (\t -> [FileData "thumb" (T.pack $ takeFileName t) "image/jpeg" t]) sendDocumentThumb
+
+    DocumentFile path ct = sendDocumentDocument
+
+
+instance ToJSON   SendDocumentRequest where toJSON = gtoJSON
+
+-- | Generate send document structure.
+toSendDocument :: SomeChatId -> DocumentFile -> SendDocumentRequest
+toSendDocument ch df = SendDocumentRequest
+  { sendDocumentChatId = ch
+  , sendDocumentDocument = df
+  , sendDocumentThumb = Nothing
+  , sendDocumentCaption = Nothing
+  , sendDocumentParseMode = Nothing
+  , sendDocumentCaptionEntities =  Nothing
+  , sendDocumentDisableContentTypeDetection = Nothing
+  , sendDocumentDisableNotification = Nothing
+  , sendDocumentReplyToMessageId = Nothing
+  , sendDocumentAllowSendingWithoutReply = Nothing
+  , sendDocumentReplyMarkup = Nothing
+  }
+
+-- ** 'getFile'
+type GetFile
+  = "getFile"
+  :> RequiredQueryParam "file_id" FileId
+  :> Get '[JSON] (Response File)
+
+getFile :: FileId -> ClientM (Response File)
+getFile = client (Proxy @GetFile)
+
+-- ** 'sendPhoto'
+type SendPhotoContent
+  = "sendPhoto"
+  :> MultipartForm Tmp SendPhotoRequest
+  :> Post '[JSON] (Response Message)
+
+type SendPhotoLink
+  = "sendPhoto"
+  :> ReqBody '[JSON] SendPhotoRequest
+  :> Post '[JSON] (Response Message)
+
+
+
+newtype PhotoFile = MakePhotoFile InputFile
+  deriving newtype ToJSON
+
+pattern PhotoFileId :: FileId -> PhotoFile
+pattern PhotoFileId x = MakePhotoFile (InputFileId x)
+
+pattern PhotoUrl :: Text -> PhotoFile
+pattern PhotoUrl x = MakePhotoFile (FileUrl x)
+
+pattern PhotoFile :: FilePath -> ContentType -> PhotoFile
+pattern PhotoFile x y = MakePhotoFile (InputFile x y)
+
+
+-- | Request parameters for 'sendPhoto'
+data SendPhotoRequest = SendPhotoRequest
+  { sendPhotoChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).
+  , sendPhotoPhoto :: PhotoFile -- ^ Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data
+  , sendPhotoThumb :: Maybe FilePath -- ^ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
+  , sendPhotoCaption :: Maybe Text -- ^ Photo caption (may also be used when resending Photos by file_id), 0-1024 characters after entities parsing
+  , sendPhotoParseMode :: Maybe ParseMode -- ^ Mode for parsing entities in the Photo caption.
+  , sendPhotoCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of /parse_mode/.
+  , sendPhotoDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendPhotoReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
+  , sendPhotoAllowSendingWithoutReply :: Maybe Bool -- ^ Pass 'True', if the message should be sent even if the specified replied-to message is not found.
+  , sendPhotoReplyMarkup :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+instance ToMultipart Tmp SendPhotoRequest where
+  toMultipart SendPhotoRequest{..} = MultipartData fields files where
+    fields =
+      [ Input "photo" $ T.pack $ "attach://file"
+      , Input "chat_id" $ case sendPhotoChatId of
+          SomeChatId (ChatId chat_id) -> T.pack $ show chat_id
+          SomeChatUsername txt -> txt
+      ] <>
+      (   (maybe id (\_ -> ((Input "thumb" "attach://thumb"):)) sendPhotoThumb)
+        $ (maybe id (\t -> ((Input "caption" t):)) sendPhotoCaption)
+        $ (maybe id (\t -> ((Input "parse_mode" (TL.toStrict $ encodeToLazyText t)):)) sendPhotoParseMode)
+        $ (maybe id (\t -> ((Input "caption_entities" (TL.toStrict $ encodeToLazyText t)):)) sendPhotoCaptionEntities)
+        $ (maybe id (\t -> ((Input "disable_notification" (bool "false" "true" t)):)) sendPhotoDisableNotification)
+        $ (maybe id (\t -> ((Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)):)) sendPhotoReplyToMessageId)
+        $ (maybe id (\t -> ((Input "allow_sending_without_reply" (bool "false" "true" t)):)) sendPhotoAllowSendingWithoutReply)
+        $ (maybe id (\t -> ((Input "reply_markup" (TL.toStrict $ encodeToLazyText t)):)) sendPhotoReplyMarkup)
+        [])
+    files
+      = (FileData "file" (T.pack $ takeFileName path) ct path)
+      : maybe [] (\t -> [FileData "thumb" (T.pack $ takeFileName t) "image/jpeg" t]) sendPhotoThumb
+
+    PhotoFile path ct = sendPhotoPhoto
+
+instance ToJSON SendPhotoRequest where toJSON = gtoJSON
+
+-- | Use this method to send photos.
+-- On success, the sent 'Message' is returned.
+--
+-- <https:\/\/core.telegram.org\/bots\/api#sendphoto>
+sendPhoto :: SendPhotoRequest -> ClientM (Response Message)
+sendPhoto r = do
+  case sendPhotoPhoto r of
+    PhotoFile{} -> do
+      boundary <- liftIO genBoundary
+      client (Proxy @SendPhotoContent) (boundary, r)
+    _ -> client (Proxy @SendPhotoLink) r
+
+-- | Request parameters for 'copyMessage'.
+data CopyMessageRequest = CopyMessageRequest
+  { copyMessageChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , copyMessageFromChatId :: SomeChatId -- ^ Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
+  , copyMessageMessageId :: MessageId -- ^ Message identifier in the chat specified in from_chat_id
+  , copyMessageCaption :: Maybe Text -- ^ New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
+  , copyMessageParseMode :: Maybe Text -- ^ Mode for parsing entities in the new caption. See formatting options for more details.
+  , copyMessageCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
+  , copyMessageDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , copyMessageProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
+  , copyMessageReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , copyMessageAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , copyMessageReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+type CopyMessage
+  = "copyMessage"
+  :> ReqBody '[JSON] CopyMessageRequest
+  :> Post '[JSON] (Response MessageId)
+
+-- | Use this method to copy messages of any kind.
+--   Service messages and invoice messages can't be
+--   copied. The method is analogous to the method
+--   forwardMessage, but the copied message doesn't
+--   have a link to the original message.
+--   Returns the MessageId of the sent message on success.
+copyMessage :: CopyMessageRequest ->  ClientM (Response MessageId)
+copyMessage = client (Proxy @CopyMessage)
+
+-- | Request parameters for 'sendAudio'.
+data SendAudioRequest = SendAudioRequest
+  { sendAudioChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendAudioAudio :: InputFile -- ^ Audio to send. Pass a file_id as String to send an audio that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a audio from the Internet, or upload a new audio using multipart/form-data. More info on Sending Files »
+  , sendAudioDuration :: Maybe Int -- ^ Duration of sent audio in seconds
+  , sendAudioPerformer :: Maybe Text -- ^ Performer
+  , sendAudioTitle :: Maybe Text -- ^ Track name
+  , sendAudioThumb :: Maybe InputFile -- ^ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+  , sendAudioCaption :: Maybe Text -- ^ Audio caption (may also be used when resending audios by file_id), 0-1024 characters after entities parsing
+  , sendAudioParseMode :: Maybe Text -- ^ Mode for parsing entities in the audio caption. See formatting options for more details.
+  , sendAudioCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
+  , sendAudioDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendAudioProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
+  , sendAudioReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , sendAudioAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendAudioReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+instance ToJSON SendAudioRequest where toJSON = gtoJSON
+
+instance ToMultipart Tmp SendAudioRequest where
+  toMultipart SendAudioRequest{..} =
+    maybe id (makeFile "thumb") sendAudioThumb $
+    makeFile "audio" sendAudioAudio $
+    MultipartData fields [] where
+    fields =
+      [ Input "chat_id" $ case sendAudioChatId of
+          SomeChatId (ChatId chat_id) -> T.pack $ show chat_id
+          SomeChatUsername txt -> txt
+      ] <> catMaybes
+      [ sendAudioCaption <&>
+        \t -> Input "caption" t
+      , sendAudioParseMode <&>
+        \t -> Input "parse_mode" t
+      , sendAudioCaptionEntities <&>
+        \t -> Input "caption_entities" (TL.toStrict $ encodeToLazyText t)
+      , sendAudioDuration <&>
+        \t -> Input "duration" (TL.toStrict $ encodeToLazyText t)
+      , sendAudioPerformer <&>
+        \t -> Input "performer" t
+      , sendAudioTitle <&>
+        \t -> Input "title" (TL.toStrict $ encodeToLazyText t)
+      , sendAudioDisableNotification <&>
+        \t -> Input "disable_notification" (bool "false" "true" t)
+      , sendAudioProtectContent <&>
+        \t -> Input "protected_content" (bool "false" "true" t)
+      , sendAudioReplyToMessageId <&>
+        \t -> Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)
+      , sendAudioAllowSendingWithoutReply <&>
+        \t -> Input "allow_sending_without_reply" (bool "false" "true" t)
+      , sendAudioReplyMarkup <&>
+        \t -> Input "reply_markup" (TL.toStrict $ encodeToLazyText t)
+      ]
+
+type SendAudioContent
+  = "sendAudio"
+  :> MultipartForm Tmp SendAudioRequest
+  :> Post '[JSON] (Response Message)
+
+type SendAudioLink
+  = "sendAudio"
+  :> ReqBody '[JSON] SendAudioRequest
+  :> Post '[JSON] (Response Message)
+
+-- | Use this method to send audio files, if
+--   you want Telegram clients to display them
+--   in the music player. Your audio must be in
+--   the .MP3 or .M4A format. On success, the sent
+--   Message is returned. Bots can currently send
+--   audio files of up to 50 MB in size, this limit
+--   may be changed in the future.
+--
+--   For sending voice messages, use the sendVoice method instead.
+sendAudio :: SendAudioRequest ->  ClientM (Response Message)
+sendAudio r = case (sendAudioAudio r, sendAudioThumb r) of
+  (InputFile{}, _) -> do
+    boundary <- liftIO genBoundary
+    client (Proxy @SendAudioContent) (boundary, r)
+  (_, Just InputFile{}) -> do
+    boundary <- liftIO genBoundary
+    client (Proxy @SendAudioContent) (boundary, r)
+  _ ->  client (Proxy @SendAudioLink) r
+
+-- | Request parameters for 'sendVideo'.
+data SendVideoRequest = SendVideoRequest
+  { sendVideoChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendVideoVideo :: InputFile -- ^ Video to send. Pass a file_id as String to send an video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More info on Sending Files »
+  , sendVideoDuration :: Maybe Int -- ^ Duration of sent video in seconds
+  , sendVideoWidth :: Maybe Int -- ^ Video width
+  , sendVideoHeight :: Maybe Int -- ^ Video height
+  , sendVideoThumb :: Maybe InputFile -- ^ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+  , sendVideoCaption :: Maybe Text -- ^ Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
+  , sendVideoParseMode :: Maybe Text -- ^ Mode for parsing entities in the video caption. See formatting options for more details.
+  , sendVideoCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
+  , sendVideoSupportsStreaming :: Maybe Bool -- ^ Pass True, if the uploaded video is suitable for streaming
+  , sendVideoDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendVideoProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
+  , sendVideoReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , sendVideoAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendVideoReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+instance ToJSON SendVideoRequest where toJSON = gtoJSON
+
+instance ToMultipart Tmp SendVideoRequest where
+  toMultipart SendVideoRequest{..} =
+    maybe id (makeFile "thumb") sendVideoThumb $
+    makeFile "video" sendVideoVideo $
+    MultipartData fields [] where
+    fields =
+      [ Input "chat_id" $ case sendVideoChatId of
+          SomeChatId (ChatId chat_id) -> T.pack $ show chat_id
+          SomeChatUsername txt -> txt
+      ] <> catMaybes
+      [ sendVideoCaption <&>
+        \t -> Input "caption" t
+      , sendVideoParseMode <&>
+        \t -> Input "parse_mode" t
+      , sendVideoCaptionEntities <&>
+        \t -> Input "caption_entities" (TL.toStrict $ encodeToLazyText t)
+      , sendVideoDuration <&>
+        \t -> Input "duration" (TL.toStrict $ encodeToLazyText t)
+      , sendVideoWidth <&>
+        \t -> Input "width" (TL.toStrict $ encodeToLazyText t)
+      , sendVideoHeight <&>
+        \t -> Input "height" (TL.toStrict $ encodeToLazyText t)
+      , sendVideoDisableNotification <&>
+        \t -> Input "disable_notification" (bool "false" "true" t)
+      , sendVideoSupportsStreaming <&>
+        \t -> Input "supports_streaming" (bool "false" "true" t)
+      , sendVideoProtectContent <&>
+        \t -> Input "protected_content" (bool "false" "true" t)
+      , sendVideoReplyToMessageId <&>
+        \t -> Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)
+      , sendVideoAllowSendingWithoutReply <&>
+        \t -> Input "allow_sending_without_reply" (bool "false" "true" t)
+      , sendVideoReplyMarkup <&>
+        \t -> Input "reply_markup" (TL.toStrict $ encodeToLazyText t)
+      ]
+
+type SendVideoContent
+  = "sendVideo"
+  :> MultipartForm Tmp SendVideoRequest
+  :> Post '[JSON] (Response Message)
+
+type SendVideoLink
+  = "sendVideo"
+  :> ReqBody '[JSON] SendVideoRequest
+  :> Post '[JSON] (Response Message)
+
+-- | Use this method to send video files,
+--   Telegram clients support mp4 videos
+--   (other formats may be sent as Document).
+--   On success, the sent Message is returned.
+--   Bots can currently send video files of up
+--   to 50 MB in size, this limit may be changed in the future.
+sendVideo :: SendVideoRequest ->  ClientM (Response Message)
+sendVideo r = case (sendVideoVideo r, sendVideoThumb r) of
+  (InputFile{}, _) -> do
+    boundary <- liftIO genBoundary
+    client (Proxy @SendVideoContent) (boundary, r)
+  (_, Just InputFile{}) -> do
+    boundary <- liftIO genBoundary
+    client (Proxy @SendVideoContent) (boundary, r)
+  _ ->  client (Proxy @SendVideoLink) r
+
+-- | Request parameters for 'sendAnimation'.
+data SendAnimationRequest = SendAnimationRequest
+  { sendAnimationChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendAnimationAnimation :: InputFile -- ^ Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More info on Sending Files »
+  , sendAnimationDuration :: Maybe Int -- ^ Duration of sent animation in seconds
+  , sendAnimationWidth :: Maybe Int -- ^ Animation width
+  , sendAnimationHeight :: Maybe Int -- ^ Animation height
+  , sendAnimationThumb :: Maybe InputFile -- ^ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+  , sendAnimationCaption :: Maybe Text -- ^ Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
+  , sendAnimationParseMode :: Maybe Text -- ^ Mode for parsing entities in the animation caption. See formatting options for more details.
+  , sendAnimationCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
+  , sendAnimationDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendAnimationProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
+  , sendAnimationReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , sendAnimationAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendAnimationReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+instance ToJSON SendAnimationRequest where toJSON = gtoJSON
+
+instance ToMultipart Tmp SendAnimationRequest where
+  toMultipart SendAnimationRequest{..} =
+    maybe id (makeFile "thumb") sendAnimationThumb $
+    makeFile "animation" sendAnimationAnimation $
+    MultipartData fields [] where
+    fields =
+      [ Input "chat_id" $ case sendAnimationChatId of
+          SomeChatId (ChatId chat_id) -> T.pack $ show chat_id
+          SomeChatUsername txt -> txt
+      ] <> catMaybes
+      [ sendAnimationCaption <&>
+        \t -> Input "caption" t
+      , sendAnimationParseMode <&>
+        \t -> Input "parse_mode" t
+      , sendAnimationCaptionEntities <&>
+        \t -> Input "caption_entities" (TL.toStrict $ encodeToLazyText t)
+      , sendAnimationDuration <&>
+        \t -> Input "duration" (TL.toStrict $ encodeToLazyText t)
+      , sendAnimationWidth <&>
+        \t -> Input "width" (TL.toStrict $ encodeToLazyText t)
+      , sendAnimationHeight <&>
+        \t -> Input "height" (TL.toStrict $ encodeToLazyText t)
+      , sendAnimationDisableNotification <&>
+        \t -> Input "disable_notification" (bool "false" "true" t)
+      , sendAnimationProtectContent <&>
+        \t -> Input "protected_content" (bool "false" "true" t)
+      , sendAnimationReplyToMessageId <&>
+        \t -> Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)
+      , sendAnimationAllowSendingWithoutReply <&>
+        \t -> Input "allow_sending_without_reply" (bool "false" "true" t)
+      , sendAnimationReplyMarkup <&>
+        \t -> Input "reply_markup" (TL.toStrict $ encodeToLazyText t)
+      ]
+
+type SendAnimationContent
+  = "sendAnimation"
+  :> MultipartForm Tmp SendAnimationRequest
+  :> Post '[JSON] (Response Message)
+
+type SendAnimationLink
+  = "sendAnimation"
+  :> ReqBody '[JSON] SendAnimationRequest
+  :> Post '[JSON] (Response Message)
+
+-- | Use this method to send animation files
+--   (GIF or H.264/MPEG-4 AVC video without sound).
+--   On success, the sent Message is returned. Bots
+--   can currently send animation files of up to 50
+--   MB in size, this limit may be changed in the future.
+sendAnimation :: SendAnimationRequest ->  ClientM (Response Message)
+sendAnimation r = case (sendAnimationAnimation r, sendAnimationThumb r) of
+  (InputFile{}, _) -> do
+    boundary <- liftIO genBoundary
+    client (Proxy @SendAnimationContent) (boundary, r)
+  (_, Just InputFile{}) -> do
+    boundary <- liftIO genBoundary
+    client (Proxy @SendAnimationContent) (boundary, r)
+  _ ->  client (Proxy @SendAnimationLink) r
+
+-- | Request parameters for 'sendVoice'.
+data SendVoiceRequest = SendVoiceRequest
+  { sendVoiceChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendVoiceVoice :: InputFile -- ^ Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
+  , sendVoiceCaption :: Maybe Text -- ^ Voice message caption, 0-1024 characters after entities parsing
+  , sendVoiceParseMode :: Maybe Text -- ^ Mode for parsing entities in the voice message caption. See formatting options for more details.
+  , sendVoiceCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
+  , sendVoiceDuration :: Maybe Int -- ^ Duration of the voice message in seconds
+  , sendVoiceDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendVoiceProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
+  , sendVoiceReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , sendVoiceAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendVoiceReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+instance ToJSON SendVoiceRequest where toJSON = gtoJSON
+
+instance ToMultipart Tmp SendVoiceRequest where
+  toMultipart SendVoiceRequest{..} =
+    makeFile "voice" sendVoiceVoice $
+    MultipartData fields [] where
+    fields =
+      [ Input "chat_id" $ case sendVoiceChatId of
+          SomeChatId (ChatId chat_id) -> T.pack $ show chat_id
+          SomeChatUsername txt -> txt
+      ] <> catMaybes
+      [ sendVoiceCaption <&>
+        \t -> Input "caption" t
+      , sendVoiceParseMode <&>
+        \t -> Input "parse_mode" t
+      , sendVoiceCaptionEntities <&>
+        \t -> Input "caption_entities" (TL.toStrict $ encodeToLazyText t)
+      , sendVoiceDuration <&>
+        \t -> Input "duration" (TL.toStrict $ encodeToLazyText t)
+      , sendVoiceProtectContent <&>
+        \t -> Input "protected_content" (bool "false" "true" t)
+      , sendVoiceDisableNotification <&>
+        \t -> Input "disable_notification" (bool "false" "true" t)
+      , sendVoiceReplyToMessageId <&>
+        \t -> Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)
+      , sendVoiceAllowSendingWithoutReply <&>
+        \t -> Input "allow_sending_without_reply" (bool "false" "true" t)
+      , sendVoiceReplyMarkup <&>
+        \t -> Input "reply_markup" (TL.toStrict $ encodeToLazyText t)
+      ]
+
+type SendVoiceContent
+  = "sendVoice"
+  :> MultipartForm Tmp SendVoiceRequest
+  :> Post '[JSON] (Response Message)
+
+type SendVoiceLink
+  = "sendVoice"
+  :> ReqBody '[JSON] SendVoiceRequest
+  :> Post '[JSON] (Response Message)
+
+-- | Use this method to send audio files,
+--   if you want Telegram clients to display
+--   the file as a playable voice message. For
+--   this to work, your audio must be in an .OGG
+--   file encoded with OPUS (other formats may be
+--   sent as Audio or Document).
+--   On success, the sent Message is returned.
+--   Bots can currently send voice messages of up
+--   to 50 MB in size, this limit may be changed in the future.
+sendVoice :: SendVoiceRequest ->  ClientM (Response Message)
+sendVoice r = case sendVoiceVoice r of
+  InputFile{} -> do
+    boundary <- liftIO genBoundary
+    client (Proxy @SendVoiceContent) (boundary, r)
+  _ ->  client (Proxy @SendVoiceLink) r
+
+-- | Request parameters for 'sendVideoNote'.
+data SendVideoNoteRequest = SendVideoNoteRequest
+  { sendVideoNoteChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendVideoNoteVideoNote :: InputFile -- ^ Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More info on Sending Files ». Sending video notes by a URL is currently unsupported
+  , sendVideoNoteDuration :: Maybe Int -- ^ Duration of sent video in seconds
+  , sendVideoNoteLength :: Maybe Int -- ^ Video width and height, i.e. diameter of the video message
+  , sendVideoNoteThumb :: Maybe InputFile -- ^ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+  , sendVideoNoteDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendVideoNoteProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
+  , sendVideoNoteReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , sendVideoNoteAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendVideoNoteReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+instance ToJSON SendVideoNoteRequest where toJSON = gtoJSON
+
+instance ToMultipart Tmp SendVideoNoteRequest where
+  toMultipart SendVideoNoteRequest{..} =
+    maybe id (makeFile "thumb") sendVideoNoteThumb $
+    makeFile "video_note" sendVideoNoteVideoNote $
+    MultipartData fields [] where
+    fields =
+      [ Input "chat_id" $ case sendVideoNoteChatId of
+          SomeChatId (ChatId chat_id) -> T.pack $ show chat_id
+          SomeChatUsername txt -> txt
+      ] <> catMaybes
+      [ sendVideoNoteDisableNotification <&>
+        \t -> Input "disable_notification" (bool "false" "true" t)
+      , sendVideoNoteProtectContent <&>
+        \t -> Input "protected_content" (bool "false" "true" t)
+      , sendVideoNoteReplyToMessageId <&>
+        \t -> Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)
+      , sendVideoNoteAllowSendingWithoutReply <&>
+        \t -> Input "allow_sending_without_reply" (bool "false" "true" t)
+      , sendVideoNoteReplyMarkup <&>
+        \t -> Input "reply_markup" (TL.toStrict $ encodeToLazyText t)
+      ]
+
+type SendVideoNoteContent
+  = "sendVideoNote"
+  :> MultipartForm Tmp SendVideoNoteRequest
+  :> Post '[JSON] (Response Message)
+
+type SendVideoNoteLink
+  = "sendVideoNote"
+  :> ReqBody '[JSON] SendVideoNoteRequest
+  :> Post '[JSON] (Response Message)
+
+-- | As of v.4.0, Telegram clients support rounded
+--   square mp4 videos of up to 1 minute long. Use
+--   this method to send video messages.
+--   On success, the sent Message is returned.
+sendVideoNote :: SendVideoNoteRequest ->  ClientM (Response Message)
+sendVideoNote r = case (sendVideoNoteVideoNote r, sendVideoNoteThumb r) of
+  (InputFile{}, _) -> do
+    boundary <- liftIO genBoundary
+    client (Proxy @SendVideoNoteContent) (boundary, r)
+  (_, Just InputFile{}) -> do
+    boundary <- liftIO genBoundary
+    client (Proxy @SendVideoNoteContent) (boundary, r)
+  _ ->  client (Proxy @SendVideoNoteLink) r
+
+-- | Request parameters for 'sendMediaGroup'.
+data SendMediaGroupRequest = SendMediaGroupRequest
+  { sendMediaGroupChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendMediaGroupMedia :: [InputMedia] -- ^ A JSON-serialized array describing messages to be sent, must include 2-10 items. InputMediaAudio, InputMediaDocument, InputMediaPhoto or InputMediaVideo.
+  , sendMediaGroupDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendMediaGroupProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
+  , sendMediaGroupReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , sendMediaGroupAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendMediaGroupReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+instance ToJSON SendMediaGroupRequest where toJSON = gtoJSON
+
+type SendMediaGroup = "sendMediaGroup"
+  :> ReqBody '[JSON] SendMediaGroupRequest
+  :> Post '[JSON] (Response [Message])
+
+-- | Use this method to send a group of photos, videos,
+--   documents or audios as an album. Documents
+--   and audio files can be only grouped in an album
+--   with messages of the same type.
+--   On success, an array of Messages that were sent is returned.
+sendMediaGroup :: SendMediaGroupRequest ->  ClientM (Response [Message])
+sendMediaGroup = client (Proxy @SendMediaGroup)
+
+-- | Request parameters for 'sendLocation'.
+data SendLocationRequest = SendLocationRequest
+  { sendLocationChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendLocationLatitude :: Float -- ^ Latitude of new location
+  , sendLocationLongitude :: Float -- ^ Longitude of new location
+  , sendLocationHorizontalAccuracy :: Maybe Float -- ^ The radius of uncertainty for the location, measured in meters; 0-1500
+  , sendLocationLivePeriod :: Int -- ^ Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.)
+  , sendLocationHeading :: Maybe Int -- ^ Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
+  , sendLocationProximityAlertRadius :: Maybe Int  -- ^ Maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
+  , sendLocationDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendLocationProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
+  , sendLocationReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , sendLocationAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendLocationReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+type SendLocation = "sendLocation"
+  :> ReqBody '[JSON] SendLocationRequest
+  :> Post '[JSON] (Response Message)
+
+-- | Use this method to send point on the map.
+--   On success, the sent Message is returned.
+sendLocation :: SendLocationRequest ->  ClientM (Response Message)
+sendLocation = client (Proxy @SendLocation)
+
+-- | Request parameters for 'editMessageLiveLocation'.
+data EditMessageLiveLocationRequest = EditMessageLiveLocationRequest
+  { editMessageLiveLocationChatId :: Maybe SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , editMessageLiveLocationMessageId :: Maybe MessageId -- ^ Required if inline_message_id is not specified. Identifier of the message with live location to stop
+  , editMessageLiveLocationInlineMessageId :: Maybe Text -- ^  	Required if chat_id and message_id are not specified. Identifier of the inline message
+  , editMessageLiveLocationLatitude :: Float -- ^ Latitude of new location
+  , editMessageLiveLocationLongitude :: Float -- ^ Longitude of new location
+  , editMessageLiveLocationHorizontalAccuracy :: Maybe Float -- ^ The radius of uncertainty for the location, measured in meters; 0-1500
+  , editMessageLiveLocationHeading :: Maybe Int -- ^ Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
+  , editMessageLiveLocationProximityAlertRadius :: Maybe Int  -- ^ Maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
+  , editMessageLiveLocationReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+type EditMessageLiveLocation = "editMessageLiveLocation"
+  :> ReqBody '[JSON] EditMessageLiveLocationRequest
+  :> Post '[JSON] (Response (Either Bool Message))
+
+-- FIXME: Add Bool returning in case of inline message. 
+
+-- | Use this method to edit live location messages.
+--   A location can be edited until its live_period
+--   expires or editing is explicitly disabled by a
+--   call to stopMessageLiveLocation. On success, if
+--   the edited message is not an inline message, the
+--   edited Message is returned, otherwise True is returned.
+editMessageLiveLocation :: EditMessageLiveLocationRequest ->  ClientM (Response (Either Bool Message))
+editMessageLiveLocation = client (Proxy @EditMessageLiveLocation)
+
+-- | Request parameters for 'stopMessageLiveLocation'.
+data StopMessageLiveLocationRequest = StopMessageLiveLocationRequest
+  { stopMessageLiveLocationChatId :: Maybe SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , stopMessageLiveLocationMessageId :: Maybe MessageId -- ^ Required if inline_message_id is not specified. Identifier of the message with live location to stop
+  , stopMessageLiveLocationInlineMessageId :: Maybe Text -- ^  	Required if chat_id and message_id are not specified. Identifier of the inline message
+  , stopMessageLiveLocationReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+type StopMessageLiveLocation = "stopMessageLiveLocation"
+  :> ReqBody '[JSON] StopMessageLiveLocationRequest
+  :> Post '[JSON] (Response (Either Bool Message))
+
+-- FIXME: Add Bool returning in case of inline message. 
+
+-- | Use this method to stop updating a live
+--   location message before live_period
+--   expires. On success, if the message is
+--   not an inline message, the edited Message
+--   is returned, otherwise True is returned.
+stopMessageLiveLocation :: StopMessageLiveLocationRequest ->  ClientM (Response (Either Bool Message))
+stopMessageLiveLocation = client (Proxy @StopMessageLiveLocation)
+
+-- | Request parameters for 'sendVenue'.
+data SendVenueRequest = SendVenueRequest
+  { sendVenueChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendVenueLatitude :: Float -- ^ Latitude of the venue
+  , sendVenueLongitude :: Float -- ^ Longitude of the venue
+  , sendVenueTitle :: Text -- ^ Name of the venue
+  , sendVenueAddress :: Text -- ^ Address of the venue
+  , sendVenueFoursquareId :: Maybe Text -- ^ Foursquare identifier of the venue
+  , sendVenueFoursquareType :: Maybe Text -- ^ Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
+  , sendVenueGooglePlaceId :: Maybe Text -- ^ Google Places identifier of the venue
+  , sendVenueGooglePlaceType :: Maybe Text -- ^ Google Places type of the venue. (See supported types <https:\/\/developers.google.com\/maps\/documentation\/places\/web-service\/supported_types>.)
+  , sendVenueDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendVenueProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
+  , sendVenueReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , sendVenueAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendVenueReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+type SendVenue = "sendVenue"
+  :> ReqBody '[JSON] SendVenueRequest
+  :> Post '[JSON] (Response Message)
+
+-- | Use this method to send information about a venue.
+--   On success, the sent Message is returned.
+sendVenue :: SendVenueRequest ->  ClientM (Response Message)
+sendVenue = client (Proxy @SendVenue)
+
+-- | Request parameters for 'sendContact'.
+data SendContactRequest = SendContactRequest
+  { sendContactChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendContactPhoneNumber :: Text -- ^ Contact's phone number
+  , sendContactFirstName  :: Text -- ^ Contact's first name
+  , sendContactLastName  :: Text -- ^ Contact's last name
+  , sendContactVcard  :: Text -- ^ Additional data about the contact in the form of a vCard, 0-2048 bytes
+  , sendContactDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendContactProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
+  , sendContactReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , sendContactAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendContactReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+type SendContact = "sendContact"
+  :> ReqBody '[JSON] SendContactRequest
+  :> Post '[JSON] (Response Message)
+
+-- | Use this method to send phone contacts.
+--   On success, the sent Message is returned.
+sendContact :: SendContactRequest ->  ClientM (Response Message)
+sendContact = client (Proxy @SendContact)
+
+-- | Request parameters for 'sendPoll'.
+data SendPollRequest = SendPollRequest
+  { sendPollChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendPollQuestion :: Text -- ^ Poll question, 1-300 characters
+  , sendPollOptions :: [Text] -- ^ A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
+  , sendPollIsAnonymous :: Maybe Bool -- ^ True, if the poll needs to be anonymous, defaults to True
+  , sendPollType :: Maybe Text -- ^ Poll type, “quiz” or “regular”, defaults to “regular”
+  , sendPollAllowsMultipleAnswers :: Maybe Bool -- ^ True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
+  , sendPollCorrectOptionId :: Maybe Int -- ^ 0-based identifier of the correct answer option, required for polls in quiz mode
+  , sendPollExplanation :: Maybe Text -- ^ Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing
+  , sendPollExplanationParseMode :: Maybe Text -- ^ Mode for parsing entities in the explanation. See formatting options for more details.
+  , sendPollExplanationEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode
+  , sendPollOpenPeriod :: Maybe Int -- ^ Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
+  , sendPollCloseDate :: Maybe Int -- ^ Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period.
+  , sendPollIsClosed :: Maybe Bool -- ^ Pass True, if the poll needs to be immediately closed. This can be useful for poll preview.
+  , sendPollDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendPollProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
+  , sendPollReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , sendPollAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendPollReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+type SendPoll = "sendPoll"
+  :> ReqBody '[JSON] SendPollRequest
+  :> Post '[JSON] (Response Message)
+
+-- | Use this method to send a native poll.
+--   On success, the sent Message is returned.
+sendPoll :: SendPollRequest ->  ClientM (Response Message)
+sendPoll = client (Proxy @SendPoll)
+
+-- | Request parameters for 'sendDice'.
+data SendDiceRequest = SendDiceRequest
+  { sendDiceChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendDiceEmoji :: Maybe Text -- ^ Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲”
+  , sendDiceDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendDiceProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding
+  , sendDiceReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
+  , sendDiceAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendDiceReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+type SendDice = "sendDice"
+  :> ReqBody '[JSON] SendDiceRequest
+  :> Post '[JSON] (Response Message)
+
+-- | Use this method to send an animated emoji that
+--   will display a random value.
+--   On success, the sent Message is returned.
+sendDice :: SendDiceRequest ->  ClientM (Response Message)
+sendDice = client (Proxy @SendDice)
+
+type SendChatAction = "sendChatAction"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> RequiredQueryParam "action" Text
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method when you need to tell the
+--   user that something is happening on the bot's side.
+--   The status is set for 5 seconds or less
+--   (when a message arrives from your bot, Telegram
+--   clients clear its typing status).
+--   Returns True on success.
+--
+--   Example: The ImageBot needs some time to
+--   process a request and upload the image.
+--   Instead of sending a text message along
+--   the lines of “Retrieving image, please wait…”,
+--   the bot may use sendChatAction with action = upload_photo.
+--   The user will see a “sending photo” status for the bot.
+--
+--   We only recommend using this method when a
+--   response from the bot will take a noticeable
+--   amount of time to arrive.
+sendChatAction :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> Text -- ^ Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
+  -> ClientM (Response  Bool)
+sendChatAction = client (Proxy @SendChatAction)
+
+-- | Request parameters for 'getUserProfilePhotos'.
+data GetUserProfilePhotosRequest = GetUserProfilePhotosRequest
+  { getUserProfilePhotosUserId :: UserId -- ^ Unique identifier of the target user
+  , getUserProfilePhotosOffset :: Maybe Int -- ^ Sequential number of the first photo to be returned. By default, all photos are returned.
+  , getUserProfilePhotosLimit :: Maybe Int -- ^ Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.
+  }
+  deriving Generic
+
+type GetUserProfilePhotos = "getUserProfilePhotos"
+  :> ReqBody '[JSON] GetUserProfilePhotosRequest
+  :> Post '[JSON] (Response UserProfilePhotos)
+
+-- | Use this method to get a list of profile pictures for a user.
+--   Returns a UserProfilePhotos object.
+getUserProfilePhotos :: GetUserProfilePhotosRequest ->  ClientM (Response UserProfilePhotos)
+getUserProfilePhotos = client (Proxy @GetUserProfilePhotos)
+
+-- | Request parameters for 'banChatMember'.
+data BanChatMemberRequest = BanChatMemberRequest
+  { banChatMemberChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , banChatMemberUserId :: UserId -- ^ Unique identifier of the target user
+  , banChatMemberUntilDate :: Maybe Int -- ^ Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.
+  , banChatMemberRevokeMessages :: Maybe Bool -- ^ Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.
+  }
+  deriving Generic
+
+type BanChatMember = "banChatMember"
+  :> ReqBody '[JSON] BanChatMemberRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to ban a user in a
+--   group, a supergroup or a channel.
+--   In the case of supergroups and channels,
+--   the user will not be able to return to
+--   the chat on their own using invite links,
+--   etc., unless unbanned first. The bot must
+--   be an administrator in the chat for this
+--   to work and must have the appropriate
+--   administrator rights.
+--   Returns True on success.
+banChatMember :: BanChatMemberRequest ->  ClientM (Response Bool)
+banChatMember = client (Proxy @BanChatMember)
+
+-- | Request parameters for 'unbanChatMember'.
+data UnbanChatMemberRequest = UnbanChatMemberRequest
+  { unbanChatMemberChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , unbanChatMemberUserId :: UserId -- ^ Unique identifier of the target user
+  , unbanChatMemberOnlyIfBanned :: Maybe Bool -- ^ Do nothing if the user is not banned
+  }
+  deriving Generic
+
+type UnbanChatMember = "unbanChatMember"
+  :> ReqBody '[JSON] UnbanChatMemberRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to unban a previously
+--   banned user in a supergroup or channel.
+--   The user will not return to the group
+--   or channel automatically, but will be
+--   able to join via link, etc. The bot must
+--   be an administrator for this to work. By
+--   default, this method guarantees that after
+--   the call the user is not a member of the chat,
+--   but will be able to join it. So if the user is
+--   a member of the chat they will also be removed
+--   from the chat. If you don't want this, use the
+--   parameter only_if_banned.
+--   Returns True on success.
+unbanChatMember :: UnbanChatMemberRequest ->  ClientM (Response Bool)
+unbanChatMember = client (Proxy @UnbanChatMember)
+
+-- | Request parameters for 'restrictChatMember'.
+data RestrictChatMemberRequest = RestrictChatMemberRequest
+  { restrictChatMemberChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , restrictChatMemberUserId :: UserId -- ^ Unique identifier of the target user
+  , restrictChatMemberPermissions :: ChatPermissions -- ^ A JSON-serialized object for new user permissions
+  , restrictChatMemberUntilDate :: Maybe Int -- ^ Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever
+  }
+  deriving Generic
+
+type RestrictChatMember = "restrictChatMember"
+  :> ReqBody '[JSON] RestrictChatMemberRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to restrict a user
+--   in a supergroup. The bot must be an
+--   administrator in the supergroup for
+--   this to work and must have the appropriate
+--   administrator rights. Pass True for all
+--   permissions to lift restrictions from a
+--   user.
+--   Returns True on success.
+restrictChatMember :: RestrictChatMemberRequest ->  ClientM (Response Bool)
+restrictChatMember = client (Proxy @RestrictChatMember)
+
+-- | Request parameters for 'promoteChatMember'.
+data PromoteChatMemberRequest = PromoteChatMemberRequest
+  { promoteChatMemberChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , promoteChatMemberUserId :: UserId -- ^ Unique identifier of the target user
+  , promoteChatMemberIsAnonymous :: Maybe Bool -- ^ Pass True, if the administrator's presence in the chat is hidden
+  , promoteChatMemberCanManageChat :: Maybe Bool -- ^ Pass True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
+  , promoteChatMemberCanPostMessages :: Maybe Bool -- ^ Pass True, if the administrator can create channel posts, channels only
+  , promoteChatMemberCanEditMessages :: Maybe Bool -- ^ Pass True, if the administrator can edit messages of other users and can pin messages, channels only
+  , promoteChatMemberCanDeleteMessages :: Maybe Bool -- ^ Pass True, if the administrator can delete messages of other users
+  , promoteChatMemberCanManageVoiceChats :: Maybe Bool -- ^ Pass True, if the administrator can manage voice chats
+  , promoteChatMemberCanRestrictMembers :: Maybe Bool -- ^ Pass True, if the administrator can restrict, ban or unban chat members
+  , promoteChatMemberCanPromoteMembers :: Maybe Bool -- ^ Pass True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)
+  , promoteChatMemberCanChangeInfo :: Maybe Bool -- ^ Pass True, if the administrator can change chat title, photo and other settings
+  , promoteChatMemberCanInviteUsers :: Maybe Bool -- ^ Pass True, if the administrator can invite new users to the chat
+  , promoteChatMemberCanPinMessages :: Maybe Bool -- ^ Pass True, if the administrator can pin messages, supergroups only
+  }
+  deriving Generic
+
+type PromoteChatMember = "promoteChatMember"
+  :> ReqBody '[JSON] PromoteChatMemberRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to promote or demote
+--   a user in a supergroup or a channel.
+--   The bot must be an administrator in
+--   the chat for this to work and must have
+--   the appropriate administrator rights.
+--   Pass False for all boolean parameters
+--   to demote a user.
+--   Returns True on success.
+promoteChatMember ::PromoteChatMemberRequest ->  ClientM (Response Bool)
+promoteChatMember = client (Proxy @PromoteChatMember)
+
+-- | Request parameters for 'setChatAdministratorCustomTitle'.
+data SetChatAdministratorCustomTitleRequest = SetChatAdministratorCustomTitleRequest
+  { setChatAdministratorCustomTitleChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , setChatAdministratorCustomTitleUserId :: UserId -- ^ Unique identifier of the target user
+  , setChatAdministratorCustomTitleCustomTitle :: Text -- ^ New custom title for the administrator; 0-16 characters, emoji are not allowed
+  }
+  deriving Generic
+
+type SetChatAdministratorCustomTitle = "setChatAdministratorCustomTitle"
+  :> ReqBody '[JSON] SetChatAdministratorCustomTitleRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to set a custom title
+--   for an administrator in a supergroup
+--   promoted by the bot.
+--   Returns True on success.
+setChatAdministratorCustomTitle :: SetChatAdministratorCustomTitleRequest ->  ClientM (Response Bool)
+setChatAdministratorCustomTitle = client (Proxy @SetChatAdministratorCustomTitle)
+
+type BanChatSenderChat = "banChatSenderChat"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> RequiredQueryParam "sender_chat_id" ChatId
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to ban a channel chat
+--   in a supergroup or a channel. Until the
+--   chat is unbanned, the owner of the banned
+--   chat won't be able to send messages on
+--   behalf of any of their channels. The bot
+--   must be an administrator in the supergroup
+--   or channel for this to work and must have
+--   the appropriate administrator rights.
+--   Returns True on success.
+banChatSenderChat :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> ChatId -- ^ Unique identifier of the target sender chat
+  -> ClientM (Response  Bool)
+banChatSenderChat = client (Proxy @BanChatSenderChat)
+
+type UnbanChatSenderChat = "unbanChatSenderChat"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> RequiredQueryParam "sender_chat_id" ChatId
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to unban a previously
+--   banned channel chat in a supergroup
+--   or channel. The bot must be an administrator
+--   for this to work and must have the appropriate
+--   administrator rights.
+--   Returns True on success.
+unbanChatSenderChat :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> ChatId -- ^ Unique identifier of the target sender chat
+  -> ClientM (Response  Bool)
+unbanChatSenderChat = client (Proxy @UnbanChatSenderChat)
+
+-- | Request parameters for 'setChatPermissions'.
+data SetChatPermissionsRequest = SetChatPermissionsRequest
+  { setChatPermissionsChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , setChatPermissionsPermissions :: ChatPermissions -- ^ A JSON-serialized object for new default chat permissions
+  }
+  deriving Generic
+
+type SetChatPermissions = "setChatPermissions"
+  :> ReqBody '[JSON] SetChatPermissionsRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to set default chat
+--   permissions for all members. The bot
+--   must be an administrator in the group
+--   or a supergroup for this to work and must
+--   have the can_restrict_members administrator rights.
+--   Returns True on success.
+setChatPermissions :: SetChatPermissionsRequest ->  ClientM (Response Bool)
+setChatPermissions = client (Proxy @SetChatPermissions)
+
+type ExportChatInviteLink = "exportChatInviteLink"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> Post '[JSON] (Response Text)
+
+-- | Use this method to generate a new
+--   primary invite link for a chat; any
+--   previously generated primary link is
+--   revoked. The bot must be an administrator
+--   in the chat for this to work and must have
+--   the appropriate administrator rights.
+--   Returns the new invite link as String on success.
+exportChatInviteLink :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> ClientM (Response  Text)
+exportChatInviteLink = client (Proxy @ExportChatInviteLink)
+
+-- | Request parameters for 'createChatInviteLink'.
+data CreateChatInviteLinkRequest = CreateChatInviteLinkRequest
+  { createChatInviteLinkChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , createChatInviteLinkName :: Maybe Text -- ^ Invite link name; 0-32 characters
+  , createChatInviteLinkExpireDate :: Maybe Integer -- ^ Point in time (Unix timestamp) when the link will expire
+  , createChatInviteLinkMemberLimit :: Maybe Int -- ^ Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
+  , createChatInviteLinkCreatesJoinRequest :: Maybe Bool -- ^ True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
+  }
+  deriving Generic
+
+type CreateChatInviteLink = "createChatInviteLink"
+  :> ReqBody '[JSON] CreateChatInviteLinkRequest
+  :> Post '[JSON] (Response ChatInviteLink)
+
+-- | Use this method to create an additional
+--   invite link for a chat. The bot must be 
+--   an administrator in the chat for this to 
+--   work and must have the appropriate administrator 
+--   rights. The link can be revoked using the 
+--   method revokeChatInviteLink. 
+--   Returns the new invite link as ChatInviteLink object.
+createChatInviteLink :: CreateChatInviteLinkRequest ->  ClientM (Response ChatInviteLink)
+createChatInviteLink = client (Proxy @CreateChatInviteLink)
+
+-- | Request parameters for 'editChatInviteLink'.
+data EditChatInviteLinkRequest = EditChatInviteLinkRequest
+  { editChatInviteLinkChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , editChatInviteLinkInviteLink :: Text -- ^	The invite link to edit
+  , editChatInviteLinkName :: Maybe Text -- ^ Invite link name; 0-32 characters
+  , editChatInviteLinkExpireDate :: Maybe Integer -- ^ Point in time (Unix timestamp) when the link will expire
+  , editChatInviteLinkMemberLimit :: Maybe Int -- ^ Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
+  , editChatInviteLinkCreatesJoinRequest :: Maybe Bool -- ^ True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
+  }
+  deriving Generic
+
+type EditChatInviteLink = "editChatInviteLink"
+  :> ReqBody '[JSON] EditChatInviteLinkRequest
+  :> Post '[JSON] (Response ChatInviteLink)
+
+-- | Use this method to edit a non-primary
+--   invite link created by the bot. The 
+--   bot must be an administrator in the 
+--   chat for this to work and must have 
+--   the appropriate administrator rights.
+--   Returns the edited invite link as a ChatInviteLink object.
+editChatInviteLink :: EditChatInviteLinkRequest ->  ClientM (Response ChatInviteLink)
+editChatInviteLink = client (Proxy @EditChatInviteLink)
+
+type RevokeChatInviteLink = "revokeChatInviteLink"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> RequiredQueryParam "invite_link" Text
+  :> Post '[JSON] (Response ChatInviteLink)
+
+-- | Use this method to revoke an invite
+--   link created by the bot. If the primary 
+--   link is revoked, a new link is automatically 
+--   generated. The bot must be an administrator 
+--   in the chat for this to work and must have 
+--   the appropriate administrator rights. 
+--   Returns the revoked invite link as ChatInviteLink object.
+revokeChatInviteLink :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> Text -- ^ The invite link to revoke
+  -> ClientM (Response  ChatInviteLink)
+revokeChatInviteLink = client (Proxy @RevokeChatInviteLink)
+
+type ApproveChatJoinRequest = "approveChatJoinRequest"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> RequiredQueryParam "user_id" UserId
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to approve a chat 
+--   join request. The bot must be an 
+--   administrator in the chat for this 
+--   to work and must have the can_invite_users 
+--   administrator right. 
+--   Returns True on success.
+approveChatJoinRequest :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> UserId -- ^ Unique identifier of the target user
+  -> ClientM (Response Bool)
+approveChatJoinRequest = client (Proxy @ApproveChatJoinRequest)
+
+type DeclineChatJoinRequest = "declineChatJoinRequest"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> RequiredQueryParam "user_id" UserId
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to decline a chat 
+--   join request. The bot must be an 
+--   administrator in the chat for this 
+--   to work and must have the can_invite_users 
+--   administrator right. 
+--   Returns True on success.
+declineChatJoinRequest :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> UserId -- ^ Unique identifier of the target user
+  -> ClientM (Response Bool)
+declineChatJoinRequest = client (Proxy @DeclineChatJoinRequest)
+
+-- | Request parameters for 'setChatPhoto'.
+data SetChatPhotoRequest = SetChatPhotoRequest
+  { setChatPhotoChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , setChatPhotoPhoto :: InputFile -- ^ 	New chat photo, uploaded using multipart/form-data
+  }
+
+instance ToMultipart Tmp SetChatPhotoRequest where
+  toMultipart SetChatPhotoRequest{..} =
+    makeFile "photo" setChatPhotoPhoto (MultipartData fields []) where
+    fields =
+      [ Input "chat_id" $ case setChatPhotoChatId of
+          SomeChatId (ChatId chat_id) -> T.pack $ show chat_id
+          SomeChatUsername txt -> txt
+      ]
+
+type SetChatPhoto = "setChatPhoto"
+  :> MultipartForm Tmp SetChatPhotoRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to set a new profile 
+--   photo for the chat. Photos can't be changed
+--   for private chats. The bot must be an 
+--   administrator in the chat for this to work 
+--   and must have the appropriate administrator rights. 
+--   Returns True on success.
+--
+-- *Note*: Only 'InputFile' case might be used in 'SetChatPhotoRequest'.
+-- Rest cases will be rejected by Telegram.
+setChatPhoto :: SetChatPhotoRequest ->  ClientM (Response Bool)
+setChatPhoto r =do
+      boundary <- liftIO genBoundary
+      client (Proxy @SetChatPhoto) (boundary, r)
+
+type DeleteChatPhoto = "deleteChatPhoto"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to delete a chat photo.
+--   Photos can't be changed for private chats.
+--   The bot must be an administrator in the chat 
+--   for this to work and must have the appropriate 
+--   administrator rights. 
+--   Returns True on success.
+deleteChatPhoto :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> ClientM (Response Bool)
+deleteChatPhoto = client (Proxy @DeleteChatPhoto)
+
+type SetChatTitle = "setChatTitle"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> RequiredQueryParam "title" Text
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to change the title of
+--   a chat. Titles can't be changed for private
+--   chats. The bot must be an administrator in 
+--   the chat for this to work and must have the 
+--   appropriate administrator rights. 
+--   Returns True on success.
+setChatTitle :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> Text -- ^ New chat title, 0-255 characters
+  -> ClientM (Response Bool)
+setChatTitle = client (Proxy @SetChatTitle)
+
+type SetChatDescription = "setChatDescription"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> QueryParam "description" Text
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to change the description 
+--   of a group, a supergroup or a channel. The 
+--   bot must be an administrator in the chat 
+--   for this to work and must have the appropriate 
+--   administrator rights. 
+--   Returns True on success.
+setChatDescription :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> Maybe Text -- ^ New chat description, 0-255 characters
+  -> ClientM (Response Bool)
+setChatDescription = client (Proxy @SetChatDescription)
+
+-- | Request parameters for 'pinChatMessage'.
+data PinChatMessageRequest = PinChatMessageRequest
+  { pinChatMessageChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , pinChatMessageMessageId :: MessageId -- ^ Identifier of a message to pin
+  , pinChatMessageDisableNotification :: Maybe Bool -- ^ Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.
+  }
+  deriving Generic
+
+type PinChatMessage = "pinChatMessage"
+  :> ReqBody '[JSON] PinChatMessageRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to add a message to the list 
+--   of pinned messages in a chat. If the chat is 
+--   not a private chat, the bot must be an administrator 
+--   in the chat for this to work and must have the 
+--   'can_pin_messages' administrator right in a supergroup
+--   or 'can_edit_messages' administrator right in a channel. 
+--   Returns True on success.
+pinChatMessage :: PinChatMessageRequest ->  ClientM (Response Bool)
+pinChatMessage = client (Proxy @PinChatMessage)
+
+type UnpinChatMessage = "unpinChatMessage"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> QueryParam "message_id" MessageId
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to remove a message from the
+--   list of pinned messages in a chat. If the chat 
+--   is not a private chat, the bot must be an administrator
+--   in the chat for this to work and must have the 
+--   'can_pin_messages' administrator right in a supergroup 
+--   or 'can_edit_messages' administrator right in a 
+--   channel. 
+--   Returns True on success.
+unpinChatMessage :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> Maybe MessageId -- ^ Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
+  -> ClientM (Response Bool)
+unpinChatMessage = client (Proxy @UnpinChatMessage)
+
+type UnpinAllChatMessages = "unpinAllChatMessages"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to clear the list of pinned 
+--   messages in a chat. If the chat is not a private 
+--   chat, the bot must be an administrator in the 
+--   chat for this to work and must have the 'can_pin_messages' 
+--   administrator right in a supergroup or 'can_edit_messages' 
+--   administrator right in a channel. 
+--   Returns True on success.
+unpinAllChatMessages :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> ClientM (Response Bool)
+unpinAllChatMessages = client (Proxy @UnpinAllChatMessages)
+
+type LeaveChat = "leaveChat"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method for your bot to leave a group, supergroup or channel. 
+--   Returns True on success.
+leaveChat :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> ClientM (Response Bool)
+leaveChat = client (Proxy @LeaveChat)
+
+type GetChat = "getChat"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> Post '[JSON] (Response Chat)
+
+-- | Use this method to get up to date information 
+--   about the chat (current name of the user for 
+--   one-on-one conversations, current username of 
+--   a user, group or channel, etc.). 
+--   Returns a Chat object on success.
+getChat :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> ClientM (Response Chat)
+getChat = client (Proxy @GetChat)
+
+type GetChatAdministrators = "getChatAdministrators"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> Post '[JSON] (Response [ChatMember])
+
+-- | Use this method to get a list of administrators
+--   in a chat. On success, returns an Array of 
+--   ChatMember objects that contains information 
+--   about all chat administrators except other bots. 
+--   If the chat is a group or a supergroup and no 
+--   administrators were appointed, only the creator 
+--   will be returned.
+getChatAdministrators :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> ClientM (Response [ChatMember])
+getChatAdministrators = client (Proxy @GetChatAdministrators)
+
+type GetChatMemberCount = "getChatMemberCount"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> Post '[JSON] (Response Integer)
+
+-- | Use this method to get the number of members in a chat. 
+--   Returns Int on success.
+getChatMemberCount :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> ClientM (Response Integer)
+getChatMemberCount = client (Proxy @GetChatMemberCount)
+
+type GetChatMember = "getChatMember"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> RequiredQueryParam "user_id" UserId
+  :> Post '[JSON] (Response ChatMember)
+
+-- | Use this method to get information about a member of a chat. 
+--   Returns a ChatMember object on success.
+getChatMember :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> UserId -- ^ 	Unique identifier of the target user
+  -> ClientM (Response ChatMember)
+getChatMember = client (Proxy @GetChatMember)
+
+type SetChatStickerSet = "setChatStickerSet"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> RequiredQueryParam "sticker_set_name" Text
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to set a new group sticker
+--   set for a supergroup. The bot must be an 
+--   administrator in the chat for this to work 
+--   and must have the appropriate administrator 
+--   rights. Use the field can_set_sticker_set 
+--   optionally returned in getChat requests to 
+--   check if the bot can use this method. 
+--   Returns True on success.
+setChatStickerSet :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> Text -- ^ 	Name of the sticker set to be set as the group sticker set
+  -> ClientM (Response Bool)
+setChatStickerSet = client (Proxy @SetChatStickerSet)
+
+type DeleteChatStickerSet = "deleteChatStickerSet"
+  :> RequiredQueryParam "chat_id" SomeChatId
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to delete a group sticker 
+--   set from a supergroup. The bot must be an 
+--   administrator in the chat for this to work 
+--   and must have the appropriate administrator 
+--   rights. Use the field can_set_sticker_set 
+--   optionally returned in getChat requests 
+--   to check if the bot can use this method. 
+--   Returns True on success.
+deleteChatStickerSet :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+  -> ClientM (Response Bool)
+deleteChatStickerSet = client (Proxy @DeleteChatStickerSet)
+
+-- | Request parameters for 'answerCallbackQuery'.
+data AnswerCallbackQueryRequest = AnswerCallbackQueryRequest
+  { answerCallbackQueryCallbackQueryId :: CallbackQueryId -- ^ Unique identifier for the query to be answered
+  , answerCallbackQueryText :: Maybe Text -- ^ Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
+  , answerCallbackQueryShowAlert :: Maybe Bool -- ^ If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
+  , answerCallbackQueryUrl :: Maybe Text
+    -- ^ URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game — note that this will only work if the query comes from a callback_game button.
+    --
+    --   Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
+  , answerCallbackQueryCacheTime :: Maybe Integer -- ^ The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.
+  }
+  deriving Generic
+
+type AnswerCallbackQuery = "answerCallbackQuery"
+  :> ReqBody '[JSON] AnswerCallbackQueryRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to send answers to callback 
+--   queries sent from inline keyboards. The answer 
+--   will be displayed to the user as a notification 
+--   at the top of the chat screen or as an alert. 
+--   On success, True is returned.
+--
+--  Alternatively, the user can be redirected to 
+--  the specified Game URL. For this option to work, 
+--  you must first create a game for your bot via 
+--  @Botfather and accept the terms. Otherwise, you 
+--  may use links like t.me/your_bot?start=XXXX that 
+--  open your bot with a parameter.
+answerCallbackQuery :: AnswerCallbackQueryRequest ->  ClientM (Response Bool)
+answerCallbackQuery = client (Proxy @AnswerCallbackQuery)
+
+-- | Request parameters for 'setMyCommands'.
+data SetMyCommandsRequest = SetMyCommandsRequest
+  { setMyCommandsCommands :: [BotCommand] -- ^ A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
+  , setMyCommandsScope :: Maybe BotCommandScope -- ^ A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
+  , setMyCommandsLanguageCode :: Maybe Text -- ^ A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
+  }
+  deriving Generic
+
+type SetMyCommands = "setMyCommands"
+  :> ReqBody '[JSON] SetMyCommandsRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to change the list of 
+--   the bot's commands. See <https:\/\/core.telegram.org\/bots#commands> 
+--   for more details about bot commands. 
+--   Returns True on success.
+setMyCommands :: SetMyCommandsRequest ->  ClientM (Response Bool)
+setMyCommands = client (Proxy @SetMyCommands)
+
+-- | Request parameters for 'deleteMyCommands'.
+data DeleteMyCommandsRequest = DeleteMyCommandsRequest
+  { deleteMyCommandsScope :: Maybe BotCommandScope  -- ^ A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault. 
+  , deleteMyCommandsLanguageCode :: Maybe Text  -- ^ 	A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
+  }
+  deriving Generic
+
+type DeleteMyCommands = "deleteMyCommands"
+  :> ReqBody '[JSON] DeleteMyCommandsRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to delete the list of 
+--   the bot's commands for the given scope 
+--   and user language. After deletion, higher 
+--   level commands will be shown to affected users. 
+--   Returns True on success.
+deleteMyCommands :: DeleteMyCommandsRequest -> ClientM (Response Bool)
+deleteMyCommands = client (Proxy @DeleteMyCommands)
+
+-- | Request parameters for 'getMyCommands'.
+data GetMyCommandsRequest = GetMyCommandsRequest
+  { getMyCommandsScope :: Maybe BotCommandScope  -- ^ A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault. 
+  , getMyCommandsLanguageCode :: Maybe Text   -- ^ 	A two-letter ISO 639-1 language code or an empty string
+  }
+  deriving Generic
+
+type GetMyCommands = "getMyCommands"
+  :> ReqBody '[JSON] GetMyCommandsRequest
+  :> Post '[JSON] (Response [BotCommand])
+
+-- | Use this method to get the current list
+--   of the bot's commands for the given scope 
+--   and user language. Returns Array of BotCommand 
+--   on success. If commands aren't set, an empty list 
+--   is returned.
+getMyCommands :: GetMyCommandsRequest -> ClientM (Response [BotCommand])
+getMyCommands = client (Proxy @GetMyCommands)
+
+foldMap deriveJSON'
+  [ ''GetMyCommandsRequest
+  , ''DeleteMyCommandsRequest
+  , ''SetMyCommandsRequest
+  , ''AnswerCallbackQueryRequest
+  , ''EditChatInviteLinkRequest
+  , ''PinChatMessageRequest
+  , ''CreateChatInviteLinkRequest
+  , ''SetChatPermissionsRequest
+  , ''SetChatAdministratorCustomTitleRequest
+  , ''PromoteChatMemberRequest
+  , ''RestrictChatMemberRequest
+  , ''UnbanChatMemberRequest
+  , ''BanChatMemberRequest
+  , ''GetUserProfilePhotosRequest
+  , ''SendDiceRequest
+  , ''SendPollRequest
+  , ''SendContactRequest
+  , ''SendVenueRequest
+  , ''StopMessageLiveLocationRequest
+  , ''EditMessageLiveLocationRequest
+  , ''SendLocationRequest
+  , ''CopyMessageRequest
+  ]
diff --git a/src/Telegram/Bot/API/Passport.hs b/src/Telegram/Bot/API/Passport.hs
new file mode 100644
--- /dev/null
+++ b/src/Telegram/Bot/API/Passport.hs
@@ -0,0 +1,28 @@
+{-# LANGUAGE TypeApplications #-}
+{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE DataKinds #-}
+module Telegram.Bot.API.Passport where
+
+import Data.Proxy
+import Servant.API
+import Servant.Client hiding (Response)
+
+import Telegram.Bot.API.Types
+import Telegram.Bot.API.MakingRequests
+
+-- * Methods
+
+-- ** 'setPassportDataErrors'
+--
+-- Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
+
+type SetPassportDataErrors
+  =  "setPassportDataErrors"
+  :> RequiredQueryParam "user_id" UserId
+  :> RequiredQueryParam "errors" [PassportElementError]
+  :> Get '[JSON] (Response Bool)
+
+-- | Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
+setPassportDataErrors :: UserId -> [PassportElementError] -> ClientM (Response Bool)
+setPassportDataErrors = client (Proxy @SetPassportDataErrors)
diff --git a/src/Telegram/Bot/API/Payments.hs b/src/Telegram/Bot/API/Payments.hs
--- a/src/Telegram/Bot/API/Payments.hs
+++ b/src/Telegram/Bot/API/Payments.hs
@@ -1,1 +1,107 @@
+{-# LANGUAGE TypeApplications #-}
+{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE DataKinds #-}
 module Telegram.Bot.API.Payments where
+
+import Data.Aeson
+import Data.Proxy
+import Data.Text
+import GHC.Generics (Generic)
+import Servant.API
+import Servant.Client hiding (Response)
+
+import Telegram.Bot.API.Internal.Utils
+import Telegram.Bot.API.Types
+import Telegram.Bot.API.MakingRequests
+
+-- * Methods
+
+-- ** 'sendInvoice'
+
+data SendInvoiceRequest = SendInvoiceRequest
+  { sendInvoiceRequestChatId                    :: ChatId                     -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername).
+  , sendInvoiceRequestTitle                     :: Text                       -- ^ Product name, 1-32 characters.
+  , sendInvoiceRequestDescription               :: Text                       -- ^ Product description, 1-255 characters.
+  , sendInvoiceRequestPayload                   :: Text                       -- ^ Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
+  , sendInvoiceRequestProviderToken             :: Text                       -- ^ Payments provider token, obtained via Botfather.
+  , sendInvoiceRequestCurrency                  :: Text                       -- ^ Three-letter ISO 4217 currency code, see more on currencies.
+  , sendInvoiceRequestPrices                    :: [LabeledPrice]             -- ^ Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.).
+  , sendInvoiceRequestMaxTipAmount              :: Maybe Integer              -- ^ The maximum accepted amount for tips in the smallest units of the currency (integer, not float\/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0.
+  , sendInvoiceRequestSuggestedTipAmounts       :: Maybe [Integer]            -- ^ A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
+  , sendInvoiceRequestStartParameter            :: Maybe Text                 -- ^ Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter.
+  , sendInvoiceRequestProviderData              :: Maybe Text                 -- ^ A JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
+  , sendInvoiceRequestPhotoUrl                  :: Maybe Text                 -- ^ URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
+  , sendInvoiceRequestPhotoSize                 :: Maybe Int                  -- ^ Photo size.
+  , sendInvoiceRequestPhotoWidth                :: Maybe Int                  -- ^ Photo width.
+  , sendInvoiceRequestPhotoHeight               :: Maybe Int                  -- ^ Photo height.
+  , sendInvoiceRequestNeedName                  :: Maybe Bool                 -- ^ Pass 'True', if you require the user's full name to complete the order.
+  , sendInvoiceRequestNeedPhoneNumber           :: Maybe Bool                 -- ^ Pass 'True', if you require the user's phone number to complete the order.
+  , sendInvoiceRequestNeedEmail                 :: Maybe Bool                 -- ^ Pass 'True', if you require the user's email address to complete the order.
+  , sendInvoiceRequestNeedShippingAddress       :: Maybe Bool                 -- ^ Pass 'True', if you require the user's shipping address to complete the order.
+  , sendInvoiceRequestSendPhoneNumberToProvider :: Maybe Bool                 -- ^ Pass 'True', if you require the user's phone number to complete the order.
+  , sendInvoiceRequestSendEmailToProvider       :: Maybe Bool                 -- ^ Pass 'True', if user's email address should be sent to provider.
+  , sendInvoiceRequestIsFlexible                :: Maybe Bool                 -- ^ Pass 'True', if the final price depends on the shipping method.
+  , sendInvoiceRequestDisableNotification       :: Maybe Bool                 -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendInvoiceRequestProtectContent            :: Maybe Bool                 -- ^ Protects the contents of the sent message from forwarding and saving.
+  , sendInvoiceRequestReplyToMessageId          :: Maybe MessageId            -- ^ If the message is a reply, ID of the original message.
+  , sendInvoiceRequestAllowSendingWithoutReply  :: Maybe Bool                 -- ^ Pass 'True', if the message should be sent even if the specified replied-to message is not found.
+  , sendInvoiceRequestReplyMarkup               :: Maybe InlineKeyboardMarkup -- ^ A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
+  }
+  deriving (Generic, Show)
+
+instance ToJSON SendInvoiceRequest where toJSON = gtoJSON
+instance FromJSON SendInvoiceRequest where parseJSON = gparseJSON
+
+type SendInvoice
+  =  "sendInvoice"
+  :> ReqBody '[JSON] SendInvoiceRequest
+  :> Post '[JSON] (Response Message)
+  
+-- | Use this method to send invoices. On success, the sent 'Message' is returned.
+sendInvoice :: SendInvoiceRequest -> ClientM (Response Message)
+sendInvoice = client (Proxy @SendInvoice)
+
+-- ** 'answerShippingQuery'
+
+data AnswerShippingQueryRequest = AnswerShippingQueryRequest
+  { answerShippingQueryRequestShippingQueryId :: Text                   -- ^ Unique identifier for the query to be answered.
+  , answerShippingQueryRequestOk              :: Bool                   -- ^ Specify 'True' if delivery to the specified address is possible and 'False' if there are any problems (for example, if delivery to the specified address is not possible).
+  , answerShippingQueryRequestShippingOptions :: Maybe [ShippingOption] -- ^ Required if @ok@ is 'True'. A JSON-serialized array of available shipping options.
+  , answerShippingQueryRequestErrorMessage    :: Maybe Text             -- ^ Required if @ok@ is 'False'. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.
+  }
+  deriving (Generic, Show)
+
+instance ToJSON AnswerShippingQueryRequest where toJSON = gtoJSON
+instance FromJSON AnswerShippingQueryRequest where parseJSON = gparseJSON
+
+type AnswerShippingQuery
+  =  "answerShippingQuery"
+  :> ReqBody '[JSON] AnswerShippingQueryRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | If you sent an invoice requesting a shipping address and the parameter @is_flexible@ was specified, the Bot API will send an 'Update' with a @shipping_query@ field to the bot. Use this method to reply to shipping queries. On success, True is returned.
+answerShippingQuery :: AnswerShippingQueryRequest -> ClientM (Response Bool)
+answerShippingQuery = client (Proxy @AnswerShippingQuery)
+
+-- ** 'answerPreCheckoutQuery'
+
+data AnswerPreCheckoutQueryRequest = AnswerPreCheckoutQueryRequest
+  { answerPreCheckoutQueryRequestPreCheckoutQueryId :: Text       -- ^ Unique identifier for the query to be answered.
+  , answerPreCheckoutQueryRequestOk                 :: Bool       -- ^ Specify 'True' if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
+  , answerPreCheckoutQueryRequestErrorMessage       :: Maybe Text -- ^ Required if @ok@ is 'False'. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.
+  }
+  deriving (Generic, Show)
+
+instance ToJSON AnswerPreCheckoutQueryRequest where toJSON = gtoJSON
+instance FromJSON AnswerPreCheckoutQueryRequest where parseJSON = gparseJSON
+
+type AnswerPreCheckoutQuery
+  =  "answerPreCheckoutQuery"
+  :> ReqBody '[JSON] AnswerPreCheckoutQueryRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, 'True' is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
+answerPreCheckoutQuery :: AnswerPreCheckoutQueryRequest -> ClientM (Response Bool)
+answerPreCheckoutQuery = client (Proxy @AnswerPreCheckoutQuery)
+
diff --git a/src/Telegram/Bot/API/Stickers.hs b/src/Telegram/Bot/API/Stickers.hs
--- a/src/Telegram/Bot/API/Stickers.hs
+++ b/src/Telegram/Bot/API/Stickers.hs
@@ -1,1 +1,329 @@
+{-# LANGUAGE DataKinds                  #-}
+{-# LANGUAGE DeriveGeneric              #-}
+
+{-# LANGUAGE OverloadedStrings          #-}
+
+{-# LANGUAGE TypeApplications           #-}
+{-# LANGUAGE TypeOperators              #-}
+{-# LANGUAGE RecordWildCards            #-}
+{-# LANGUAGE MultiParamTypeClasses      #-}
+{-# LANGUAGE LambdaCase #-}
+
 module Telegram.Bot.API.Stickers where
+
+import Control.Monad.IO.Class
+import Data.Aeson
+import Data.Aeson.Text
+import Data.Bool
+import qualified Data.Text as T
+import qualified Data.Text.Lazy as TL
+import Data.Proxy
+import GHC.Generics (Generic)
+import Servant.API
+import Servant.Client hiding (Response)
+import Servant.Multipart
+import Servant.Multipart.Client
+
+import Telegram.Bot.API.Internal.Utils
+import Telegram.Bot.API.MakingRequests (Response)
+import Telegram.Bot.API.Types
+import Data.Maybe (catMaybes, maybeToList)
+import Data.Functor
+
+
+-- | Type of uploaded sticker file. Static or animated.
+data StickerType
+  = PngSticker -- ^ PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data.
+  | TgsSticker -- ^ TGS animation with the sticker, uploaded using multipart/form-data. See <https:\/\/core.telegram.org\/animated_stickers#technical-requirements> for technical requirements
+
+stickerLabel :: StickerType -> T.Text
+stickerLabel = \case
+  PngSticker -> "png_sticker"
+  TgsSticker -> "tgs_sticker"
+
+-- | Sticker file with static/animated label.
+data StickerFile = StickerFile {stickerFileSticker :: InputFile, stickerFileLabel :: StickerType}
+
+-- | Request parameters for 'sendSticker'.
+data SendStickerRequest = SendStickerRequest
+  { sendStickerChatId                   :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , sendStickerSticker                  :: InputFile -- ^ Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. 
+  , sendStickerDisableNotification      :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
+  , sendStickerReplyToMessageId         :: Maybe MessageId -- ^	If the message is a reply, ID of the original message
+  , sendStickerAllowSendingWithoutReply :: Maybe Bool -- ^ Pass True, if the message should be sent even if the specified replied-to message is not found
+  , sendStickerReplyMarkup              :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+  }
+  deriving Generic
+
+instance ToJSON SendStickerRequest where toJSON = gtoJSON
+
+instance ToMultipart Tmp SendStickerRequest where
+  toMultipart SendStickerRequest{..} = 
+    makeFile "sticker" sendStickerSticker (MultipartData fields []) where
+    fields =
+      [ Input "chat_id" $ case sendStickerChatId of
+          SomeChatId (ChatId chat_id) -> T.pack $ show chat_id
+          SomeChatUsername txt -> txt
+      ] <> catMaybes
+      [ sendStickerDisableNotification <&>
+        \t -> Input "disable_notification" (bool "false" "true" t)
+      , sendStickerReplyToMessageId <&>
+        \t -> Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)
+      , sendStickerAllowSendingWithoutReply <&>
+        \t -> Input "allow_sending_without_reply" (bool "false" "true" t)
+      , sendStickerReplyMarkup <&>
+        \t -> Input "reply_markup" (TL.toStrict $ encodeToLazyText t)
+      ]
+
+type SendStickerContent
+  = "sendSticker"
+  :> MultipartForm Tmp SendStickerRequest
+  :> Post '[JSON] (Response Message)
+
+type SendStickerLink
+  = "sendSticker"
+  :> ReqBody '[JSON] SendStickerRequest
+  :> Post '[JSON] (Response Message)
+
+-- | Use this method to send static .WEBP or animated .TGS stickers. 
+--   On success, the sent Message is returned.
+sendSticker :: SendStickerRequest -> ClientM (Response Message)
+sendSticker r =
+  case sendStickerSticker r of
+    InputFile{} -> do
+      boundary <- liftIO genBoundary
+      client (Proxy @SendStickerContent) (boundary, r)
+    _ -> client (Proxy @SendStickerLink) r
+
+
+-- | Request parameters for 'uploadStickerFile'.
+data UploadStickerFileRequest = UploadStickerFileRequest
+  { uploadStickerFileUserId :: UserId -- ^ User identifier of sticker file owner
+  , uploadStickerFilePngSticker :: InputFile -- ^ PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 
+  } deriving Generic
+
+instance ToJSON UploadStickerFileRequest where toJSON = gtoJSON
+
+instance ToMultipart Tmp UploadStickerFileRequest where
+  toMultipart UploadStickerFileRequest{..} = 
+    makeFile "png_sticker" uploadStickerFilePngSticker (MultipartData fields []) where
+    fields = [ Input "user_id" $ T.pack . show $ uploadStickerFileUserId ]
+
+type UploadStickerFileContent
+  = "uploadStickerFile"
+  :> MultipartForm Tmp UploadStickerFileRequest
+  :> Post '[JSON] (Response File)
+
+type UploadStickerFileLink
+  = "uploadStickerFile"
+  :> ReqBody '[JSON] UploadStickerFileRequest
+  :> Post '[JSON] (Response File)
+
+-- | Use this method to upload a .PNG file 
+--   with a sticker for later use in createNewStickerSet 
+--   and addStickerToSet methods (can be used multiple times). 
+--   Returns the uploaded File on success.
+uploadStickerFile :: UploadStickerFileRequest -> ClientM (Response File)
+uploadStickerFile r =
+  case uploadStickerFilePngSticker r of
+    InputFile{} -> do
+      boundary <- liftIO genBoundary
+      client (Proxy @UploadStickerFileContent) (boundary, r)
+    _ -> client (Proxy @UploadStickerFileLink) r
+
+
+-- | Request parameters for 'createNewStickerSet'.
+data CreateNewStickerSetRequest = CreateNewStickerSetRequest
+  { createNewStickerSetUserId :: UserId -- ^ User identifier of created sticker set owner
+  , createNewStickerSetName :: T.Text -- ^ Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “_by_<bot username>”. <bot_username> is case insensitive. 1-64 characters.
+  , createNewStickerSetTitle :: T.Text -- ^ Sticker set title, 1-64 characters
+  , createNewStickerSetSticker :: StickerFile -- ^ Sticker file to upload
+  , createNewStickerSetEmojis :: T.Text -- ^ One or more emoji corresponding to the sticker
+  , createNewStickerSetContainsMasks :: Maybe Bool -- ^ Pass True, if a set of mask stickers should be created
+  , createNewStickerSetMaskPosition :: Maybe MaskPosition -- ^ A JSON-serialized object for position where the mask should be placed on faces
+  } deriving Generic
+
+instance ToJSON CreateNewStickerSetRequest where 
+  toJSON CreateNewStickerSetRequest{..} = object
+    [ "user_id" .= createNewStickerSetUserId
+    , "name" .= createNewStickerSetName
+    , "title" .= createNewStickerSetTitle
+    , stickerLabel stickerFileLabel .= stickerFileSticker
+    , "emojis" .= createNewStickerSetEmojis
+    , "contains_mask" .= createNewStickerSetContainsMasks
+    , "mask_position" .= createNewStickerSetMaskPosition
+    ]
+    where
+      StickerFile{..} = createNewStickerSetSticker
+
+instance ToMultipart Tmp CreateNewStickerSetRequest where
+  toMultipart CreateNewStickerSetRequest{..} = 
+    makeFile (stickerLabel stickerFileLabel) stickerFileSticker (MultipartData fields []) where
+    fields =
+      [ Input "user_id" $ T.pack . show $ createNewStickerSetUserId
+      , Input "name" createNewStickerSetName
+      , Input "title" createNewStickerSetTitle
+      , Input "emojis" createNewStickerSetEmojis
+      ] <> catMaybes
+      [ createNewStickerSetContainsMasks <&>
+        \t -> Input "contains_masks" (bool "false" "true" t)
+      , createNewStickerSetMaskPosition <&>
+        \t -> Input "mask_position" (TL.toStrict $ encodeToLazyText t)
+      ]
+    StickerFile {..} = createNewStickerSetSticker
+
+type CreateNewStickerSetContent
+  = "createNewStickerSet"
+  :> MultipartForm Tmp CreateNewStickerSetRequest
+  :> Post '[JSON] (Response Bool)
+
+type CreateNewStickerSetLink
+  = "createNewStickerSet"
+  :> ReqBody '[JSON] CreateNewStickerSetRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to create a new sticker 
+--   set owned by a user. The bot will be able 
+--   to edit the sticker set thus created. You 
+--   must use exactly one of the fields png_sticker or tgs_sticker. 
+--   Returns True on success.
+createNewStickerSet :: CreateNewStickerSetRequest -> ClientM (Response Bool)
+createNewStickerSet r =
+  case stickerFileSticker $ createNewStickerSetSticker r of
+    InputFile{} -> do
+      boundary <- liftIO genBoundary
+      client (Proxy @CreateNewStickerSetContent) (boundary, r)
+    _ -> client (Proxy @CreateNewStickerSetLink) r
+
+-- | Request parameters for 'addStickerToSet'.
+data AddStickerToSetRequest = AddStickerToSetRequest
+  { addStickerToSetUserId :: UserId -- ^ User identifier of sticker set owner
+  , addStickerToSetName :: T.Text -- ^ Sticker set name
+  , addStickerToSetSticker :: StickerFile -- ^ Sticker file to upload 
+  , addStickerToSetEmojis :: T.Text -- ^ One or more emoji corresponding to the sticker
+  , addStickerToSetMaskPosition :: Maybe MaskPosition -- ^ A JSON-serialized object for position where the mask should be placed on faces
+  } deriving Generic
+
+instance ToJSON AddStickerToSetRequest where
+  toJSON AddStickerToSetRequest{..} = object
+    [ "user_id" .= addStickerToSetUserId
+    , "name" .= addStickerToSetName
+    , stickerLabel stickerFileLabel .= stickerFileSticker
+    , "emojis" .= addStickerToSetEmojis
+    , "mask_position" .= addStickerToSetMaskPosition
+    ]
+    where
+      StickerFile{..} = addStickerToSetSticker
+
+instance ToMultipart Tmp AddStickerToSetRequest where
+  toMultipart AddStickerToSetRequest{..} = 
+    makeFile (stickerLabel stickerFileLabel) stickerFileSticker (MultipartData fields []) where
+    fields =
+      [ Input "user_id" $ T.pack . show $ addStickerToSetUserId
+      , Input "name" addStickerToSetName
+      , Input "emojis" addStickerToSetEmojis
+      ] <> maybeToList
+      ( addStickerToSetMaskPosition <&>
+        \t -> Input "mask_position" (TL.toStrict $ encodeToLazyText t)
+      )
+    StickerFile {..} = addStickerToSetSticker
+
+type AddStickerToSetContent
+  = "addStickerToSet"
+  :> MultipartForm Tmp AddStickerToSetRequest
+  :> Post '[JSON] (Response Bool)
+
+type AddStickerToSetLink
+  = "addStickerToSet"
+  :> ReqBody '[JSON] AddStickerToSetRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to add a new sticker to a set 
+--   created by the bot. You must use exactly one of 
+--   the fields png_sticker or tgs_sticker. Animated 
+--   stickers can be added to animated sticker sets and 
+--   only to them. Animated sticker sets can have up to 50 
+--   stickers. Static sticker sets can have up to 120 stickers. 
+--   Returns True on success.
+addStickerToSet :: AddStickerToSetRequest -> ClientM (Response Bool)
+addStickerToSet r =
+  case stickerFileSticker $ addStickerToSetSticker r of
+    InputFile{} -> do
+      boundary <- liftIO genBoundary
+      client (Proxy @AddStickerToSetContent) (boundary, r)
+    _ -> client (Proxy @AddStickerToSetLink) r
+
+
+type GetStickerSet
+  = "getStickerSet"
+  :> RequiredQueryParam "name" T.Text
+  :> Get '[JSON] (Response StickerSet)
+
+-- | Use this method to get a sticker set. On success, a StickerSet object is returned.
+getStickerSet :: T.Text -- ^ Name of the sticker set
+  -> ClientM (Response StickerSet)
+getStickerSet = client (Proxy @GetStickerSet)
+
+type SetStickerPositionInSet
+  = "setStickerPositionInSet"
+  :> RequiredQueryParam "sticker" T.Text
+  :> RequiredQueryParam "position" Integer
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to move a sticker in a set created by the bot to a specific position. 
+--   Returns True on success.
+setStickerPositionInSet :: T.Text -- ^ File identifier of the sticker
+  -> Integer -- ^ New sticker position in the set, zero-based
+  -> ClientM (Response Bool)
+setStickerPositionInSet = client (Proxy @SetStickerPositionInSet)
+
+
+type DeleteStickerFromSet
+  = "deleteStickerFromSet"
+  :> RequiredQueryParam "sticker" T.Text
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to delete a sticker from a set created by the bot. 
+--   Returns True on success.
+deleteStickerFromSet :: T.Text -- ^ File identifier of the sticker
+  -> ClientM (Response Bool)
+deleteStickerFromSet = client (Proxy @DeleteStickerFromSet)
+
+-- | Request parameters for 'setStickerSetThumb'.
+data SetStickerSetThumbRequest = SetStickerSetThumbRequest
+  { setStickerSetThumbName :: T.Text -- ^ Sticker set name
+  , setStickerSetThumbUserId :: UserId -- ^ User identifier of the sticker set owner
+  , setStickerSetThumbThumb :: InputFile -- ^ A PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; see <https:\/\/core.telegram.org\/animated_stickers#technical-requirements> for animated sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. Animated sticker set thumbnail can't be uploaded via HTTP URL.
+  } deriving Generic
+
+instance ToJSON SetStickerSetThumbRequest where toJSON = gtoJSON
+
+instance ToMultipart Tmp SetStickerSetThumbRequest where
+  toMultipart SetStickerSetThumbRequest{..} = 
+    makeFile "png_sticker" setStickerSetThumbThumb (MultipartData fields []) where
+    fields =
+      [ Input "user_id" $ T.pack . show $ setStickerSetThumbUserId
+      , Input "name" setStickerSetThumbName
+      ]
+
+type SetStickerSetThumbContent
+  = "setStickerSetThumb"
+  :> MultipartForm Tmp SetStickerSetThumbRequest
+  :> Post '[JSON] (Response Bool)
+
+type SetStickerSetThumbLink
+  = "setStickerSetThumb"
+  :> ReqBody '[JSON] SetStickerSetThumbRequest
+  :> Post '[JSON] (Response Bool)
+
+-- | Use this method to set the thumbnail of a sticker set. 
+--   Animated thumbnails can be set for animated sticker sets only. 
+--   Returns True on success.
+setStickerSetThumb :: SetStickerSetThumbRequest -> ClientM (Response Bool)
+setStickerSetThumb r =
+  case setStickerSetThumbThumb r of
+    InputFile{} -> do
+      boundary <- liftIO genBoundary
+      client (Proxy @SetStickerSetThumbContent) (boundary, r)
+    _ -> client (Proxy @SetStickerSetThumbLink) r
+
diff --git a/src/Telegram/Bot/API/Types.hs b/src/Telegram/Bot/API/Types.hs
--- a/src/Telegram/Bot/API/Types.hs
+++ b/src/Telegram/Bot/API/Types.hs
@@ -1,512 +1,1343 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE TemplateHaskell #-}
-{-# LANGUAGE TypeApplications #-}
-module Telegram.Bot.API.Types where
-
-import Data.Aeson (ToJSON(..), FromJSON(..))
-import Data.Coerce (coerce)
-import Data.Int (Int32)
-import Data.Hashable (Hashable)
-import Data.String
-import Data.Text (Text, pack)
-import Data.Time.Clock.POSIX (POSIXTime)
-import GHC.Generics (Generic)
-import Servant.API
-
-import Telegram.Bot.API.Internal.Utils
-
-type RequiredQueryParam = QueryParam' '[Required , Strict]
-
-newtype Seconds = Seconds Int32
-  deriving (Eq, Show, Num, ToJSON, FromJSON)
-
--- * Available types
-
--- ** User
-
--- | This object represents a Telegram user or bot.
---
--- <https://core.telegram.org/bots/api#user>
-data User = User
-  { userId           :: UserId     -- ^ Unique identifier for this user or bot.
-  , userIsBot        :: Bool       -- ^ 'True', if this user is a bot.
-  , userFirstName    :: Text       -- ^ User's or bot's first name.
-  , userLastName     :: Maybe Text -- ^ User‘s or bot’s last name
-  , userUsername     :: Maybe Text -- ^ User‘s or bot’s username
-  , userLanguageCode :: Maybe Text -- ^ IETF language tag of the user's language
-  }
-  deriving (Show, Generic)
-
--- | Unique identifier for this user or bot.
-newtype UserId = UserId Int32
-  deriving (Eq, Show, ToJSON, FromJSON)
-
-instance ToHttpApiData UserId where
-  toUrlPiece = pack . show @Int32 . coerce
-
--- ** Chat
-
--- | This object represents a chat.
---
--- <https://core.telegram.org/bots/api#chat>
-data Chat = Chat
-  { chatId               :: ChatId          -- ^ Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
-  , chatType             :: ChatType        -- ^ Type of chat.
-  , chatTitle            :: Maybe Text      -- ^ Title, for supergroups, channels and group chats
-  , chatUsername         :: Maybe Text      -- ^ Username, for private chats, supergroups and channels if available
-  , chatFirstName        :: Maybe Text      -- ^ First name of the other party in a private chat
-  , chatLastName         :: Maybe Text      -- ^ Last name of the other party in a private chat
-  , chatAllMembersAreAdministrators :: Maybe Bool      -- ^ 'True' if a group has ‘All Members Are Admins’ enabled.
-  , chatPhoto            :: Maybe ChatPhoto -- ^ Chat photo. Returned only in getChat.
-  , chatDescription      :: Maybe Text      -- ^ Description, for supergroups and channel chats. Returned only in getChat.
-  , chatInviteLink       :: Maybe Text      -- ^ Chat invite link, for supergroups and channel chats. Returned only in getChat.
-  , chatPinnedMessage    :: Maybe Message   -- ^ Pinned message, for supergroups. Returned only in getChat.
-  , chatStickerSetName   :: Maybe Text      -- ^ For supergroups, name of group sticker set. Returned only in getChat.
-  , chatCanSetStickerSet :: Maybe Bool      -- ^ True, if the bot can change the group sticker set. Returned only in getChat.
-  }
-  deriving (Generic, Show)
-
--- | Unique identifier for this chat.
-newtype ChatId = ChatId Integer
-  deriving (Eq, Show, ToJSON, FromJSON, Hashable)
-
-instance ToHttpApiData ChatId where
-  toUrlPiece a = pack . show @Integer $ coerce a
-
--- | Type of chat.
-data ChatType
-  = ChatTypePrivate
-  | ChatTypeGroup
-  | ChatTypeSupergroup
-  | ChatTypeChannel
-  deriving (Generic, Show)
-
-instance ToJSON   ChatType where
-  toJSON = gtoJSON
-instance FromJSON ChatType where
-  parseJSON = gparseJSON
-
--- ** Message
-
--- | This object represents a message.
-data Message = Message
-  { messageMessageId             :: MessageId -- ^ Unique message identifier inside this chat
-  , messageFrom                  :: Maybe User -- ^ Sender, empty for messages sent to channels
-  , messageDate                  :: POSIXTime -- ^ Date the message was sent in Unix time
-  , messageChat                  :: Chat -- ^ Conversation the message belongs to
-  , messageForwardFrom           :: Maybe User -- ^ For forwarded messages, sender of the original message
-  , messageForwardFromChat       :: Maybe Chat -- ^ For messages forwarded from channels, information about the original channel
-  , messageForwardFromMessageId  :: Maybe MessageId -- ^ For messages forwarded from channels, identifier of the original message in the channel
-  , messageForwardSignature      :: Maybe Text -- ^ For messages forwarded from channels, signature of the post author if present
-  , messageForwardDate           :: Maybe POSIXTime -- ^ For forwarded messages, date the original message was sent in Unix time
-  , messageReplyToMessage        :: Maybe Message -- ^ For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
-  , messageEditDate              :: Maybe POSIXTime -- ^ Date the message was last edited in Unix time
-  , messageMediaGroupId          :: Maybe MediaGroupId -- ^ The unique identifier of a media message group this message belongs to
-  , messageAuthorSignature       :: Maybe Text -- ^ Signature of the post author for messages in channels
-  , messageText                  :: Maybe Text -- ^ For text messages, the actual UTF-8 text of the message, 0-4096 characters.
-  , messageEntities              :: Maybe [MessageEntity] -- ^ For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
-  , messageCaptionEntities       :: Maybe [MessageEntity] -- ^ For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
-  , messageAudio                 :: Maybe Audio -- ^ Message is an audio file, information about the file
-  , messageDocument              :: Maybe Document -- ^ Message is a general file, information about the file
-
---  , messageGame :: Maybe Game -- ^ Message is a game, information about the game. More about games »
-  , messagePhoto                 :: Maybe [PhotoSize] -- ^ Message is a photo, available sizes of the photo
-  , messageSticker               :: Maybe Sticker -- ^ Message is a sticker, information about the sticker
-  , messageVideo                 :: Maybe Video -- ^ Message is a video, information about the video
-  , messageVoice                 :: Maybe Voice -- ^ Message is a voice message, information about the file
-  , messageVideoNote             :: Maybe VideoNote -- ^ Message is a video note, information about the video message
-  , messageCaption               :: Maybe Text -- ^ Caption for the audio, document, photo, video or voice, 0-200 characters
-  , messageContact               :: Maybe Contact -- ^ Message is a shared contact, information about the contact
-  , messageLocation              :: Maybe Location -- ^ Message is a shared location, information about the location
-  , messageVenue                 :: Maybe Venue -- ^ Message is a venue, information about the venue
-  , messageNewChatMembers        :: Maybe [User] -- ^ New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
-  , messageLeftChatMember        :: Maybe User -- ^ A member was removed from the group, information about them (this member may be the bot itself)
-  , messageNewChatTitle          :: Maybe Text -- ^ A chat title was changed to this value
-  , messageNewChatPhoto          :: Maybe [PhotoSize] -- ^ A chat photo was change to this value
-  , messageDeleteChatPhoto       :: Maybe Bool -- ^ Service message: the chat photo was deleted
-  , messageGroupChatCreated      :: Maybe Bool -- ^ Service message: the group has been created
-  , messageSupergroupChatCreated :: Maybe Bool -- ^ Service message: the supergroup has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
-  , messageChannelChatCreated    :: Maybe Bool -- ^ Service message: the channel has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
-  , messageMigrateToChatId       :: Maybe ChatId -- ^ The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
-  , messageMigrateFromChatId     :: Maybe ChatId -- ^ The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
-  , messagePinnedMessage         :: Maybe Message -- ^ Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
-
---  , messageInvoice :: Maybe Invoice -- ^ Message is an invoice for a payment, information about the invoice. More about payments »
---  , messageSuccessfulPayment :: Maybe SuccessfulPayment -- ^ Message is a service message about a successful payment, information about the payment. More about payments »
-  }
-  deriving (Generic, Show)
-
--- | Unique message identifier inside this chat.
-newtype MessageId = MessageId Int32
-  deriving (Eq, Show, ToJSON, FromJSON, Hashable)
-
-instance ToHttpApiData MessageId where
-  toUrlPiece a = pack . show @Int32 $ coerce a
-
--- | The unique identifier of a media message group a message belongs to.
-newtype MediaGroupId = MediaGroupId Text
-  deriving (Eq, Show, ToJSON, FromJSON)
-
--- ** MessageEntity
-
--- | This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
-data MessageEntity = MessageEntity
-  { messageEntityType   :: MessageEntityType -- ^ Type of the entity. Can be mention (@username), hashtag, bot_command, url, email, bold (bold text), italic (italic text), underline (underlined text), strikethrough, code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames)
-  , messageEntityOffset :: Int32 -- ^ Offset in UTF-16 code units to the start of the entity
-  , messageEntityLength :: Int32 -- ^ Length of the entity in UTF-16 code units
-  , messageEntityUrl    :: Maybe Text -- ^ For “text_link” only, url that will be opened after user taps on the text
-  , messageEntityUser   :: Maybe User -- ^ For “text_mention” only, the mentioned user
-  }
-  deriving (Generic, Show)
-
--- | Type of the entity. Can be mention (@username), hashtag, bot_command, url, email, bold (bold text), italic (italic text), underline (underlined text), strikethrough, code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames), cashtag, phone_number
-data MessageEntityType
-  = MessageEntityMention
-  | MessageEntityHashtag
-  | MessageEntityBotCommand
-  | MessageEntityUrl
-  | MessageEntityEmail
-  | MessageEntityBold
-  | MessageEntityItalic
-  | MessageEntityUnderline -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_underline.html>
-  | MessageEntityStrikethrough -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_strikethrough.html>
-  | MessageEntityCode
-  | MessageEntityPre
-  | MessageEntityTextLink
-  | MessageEntityTextMention
-  | MessageEntityCashtag -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_cashtag.html>.
-  | MessageEntityPhoneNumber -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_phone_number.html>.
-  deriving (Eq, Show, Generic)
-
-instance ToJSON   MessageEntityType where
-  toJSON = gtoJSON
-instance FromJSON MessageEntityType where
-  parseJSON = gparseJSON
-
--- ** 'PhotoSize'
-
--- | This object represents one size of a photo or a file / sticker thumbnail.
-data PhotoSize = PhotoSize
-  { photoSizeFileId   :: FileId      -- ^ Unique identifier for this file
-  , photoSizeWidth    :: Int32       -- ^ Photo width
-  , photoSizeHeight   :: Int32       -- ^ Photo height
-  , photoSizeFileSize :: Maybe Int32 -- ^ File size
-  }
-  deriving (Generic, Show)
-
--- | Unique identifier for this file.
-newtype FileId = FileId Text
-  deriving (Eq, Show, ToJSON, FromJSON)
-
-instance ToHttpApiData FileId where
-  toUrlPiece = coerce
-
--- ** 'Audio'
-
--- | This object represents an audio file to be treated as music by the Telegram clients.
-data Audio = Audio
-  { audioFileId    :: FileId -- ^ Unique identifier for this file
-  , audioDuration  :: Seconds -- ^ Duration of the audio in seconds as defined by sender
-  , audioPerformer :: Maybe Text -- ^ Performer of the audio as defined by sender or by audio tags
-  , audioTitle     :: Maybe Text -- ^ Title of the audio as defined by sender or by audio tags
-  , audioMimeType  :: Maybe Text -- ^ MIME type of the file as defined by sender
-  , audioFileSize  :: Maybe Int32 -- ^ File size
-  }
-  deriving (Generic, Show)
-
--- ** 'Document'
-
--- | This object represents a general file (as opposed to photos, voice messages and audio files).
-data Document = Document
-  { documentFileId   :: FileId -- ^ Unique file identifier
-  , documentThumb    :: Maybe PhotoSize -- ^ Document thumbnail as defined by sender
-  , documentFileName :: Maybe Text -- ^ Original filename as defined by sender
-  , documentMimeType :: Maybe Text -- ^ MIME type of the file as defined by sender
-  , documentFileSize :: Maybe Int32 -- ^ File size
-  }
-  deriving (Generic, Show)
-
--- ** 'Sticker'
-
--- | This object represents a sticker.
-
-data Sticker = Sticker
-  { stickerFileId       :: FileId
-  , stickerFileUniqueId :: FileId
-  , stickerWidth        :: Int32
-  , stickerHeight       :: Int32
-  , stickerIsAnimated   :: Bool
-  , stickerThumb        :: Maybe PhotoSize
-  , stickerEmoji        :: Maybe Text
-  , stickerSetName      :: Maybe Text
-  -- , stickerMaskPosition :: Maybe MaskPosition
-  , stickerFileSize     :: Maybe Integer
-  }
-  deriving (Generic, Show)
-
--- ** 'Video'
-
--- | This object represents a video file.
-data Video = Video
-  { videoFileId   :: FileId -- ^ Unique identifier for this file
-  , videoWidth    :: Int32 -- ^ Video width as defined by sender
-  , videoHeight   :: Int32 -- ^ Video height as defined by sender
-  , videoDuration :: Seconds -- ^ Duration of the video in seconds as defined by sender
-  , videoThumb    :: Maybe PhotoSize -- ^ Video thumbnail
-  , videoMimeType :: Maybe Text -- ^ Mime type of a file as defined by sender
-  , videoFileSize :: Maybe Int32 -- ^ File size
-  }
-  deriving (Generic, Show)
-
--- ** 'Voice'
-
--- | This object represents a voice note.
-data Voice = Voice
-  { voiceFileId   :: FileId -- ^ Unique identifier for this file
-  , voiceDuration :: Seconds -- ^ Duration of the audio in seconds as defined by sender
-  , voiceMimeType :: Maybe Text -- ^ MIME type of the file as defined by sender
-  , voiceFileSize :: Maybe Int32 -- ^ File size
-  }
-  deriving (Generic, Show)
-
--- ** 'VideoNote'
-
--- | This object represents a video message (available in Telegram apps as of v.4.0).
-data VideoNote = VideoNote
-  { videoNoteFileId   :: Text -- ^ Unique identifier for this file
-  , videoNoteLength   :: Int32 -- ^ Video width and height as defined by sender
-  , videoNoteDuration :: Seconds -- ^ Duration of the video in seconds as defined by sender
-  , videoNoteThumb    :: Maybe PhotoSize -- ^ Video thumbnail
-  , videoNoteFileSize :: Maybe Int32 -- ^ File size
-  }
-  deriving (Generic, Show)
-
--- ** 'Contact'
-
--- | This object represents a phone contact.
-data Contact = Contact
-  { contactPhoneNumber :: Text -- ^ Contact's phone number
-  , contactFirstName   :: Text -- ^ Contact's first name
-  , contactLastName    :: Maybe Text -- ^ Contact's last name
-  , contactUserId      :: Maybe UserId -- ^ Contact's user identifier in Telegram
-  }
-  deriving (Generic, Show)
-
--- ** Location
-
--- | This object represents a point on the map.
-data Location = Location
-  { locationLongitude :: Float -- ^ Longitude as defined by sender
-  , locationLatitude  :: Float -- ^ Latitude as defined by sender
-  }
-  deriving (Generic, Show)
-
--- ** 'Venue'
-
--- | This object represents a venue.
-data Venue = Venue
-  { venueLocation     :: Location -- ^ Venue location
-  , venueTitle        :: Text -- ^ Name of the venue
-  , venueAddress      :: Text -- ^ Address of the venue
-  , venueFoursquareId :: Maybe Text -- ^ Foursquare identifier of the venue
-  }
-  deriving (Generic, Show)
-
--- ** 'UserProfilePhotos'
-
--- | This object represent a user's profile pictures.
-data UserProfilePhotos = UserProfilePhotos
-  { userProfilePhotosTotalCount :: Int32 -- ^ Total number of profile pictures the target user has
-  , userProfilePhotosPhotos     :: [[PhotoSize]] -- ^ Requested profile pictures (in up to 4 sizes each)
-  }
-  deriving (Generic, Show)
-
--- ** 'File'
-
--- | This object represents a file ready to be downloaded.
--- The file can be downloaded via the link @https://api.telegram.org/file/bot<token>/<file_path>@.
--- It is guaranteed that the link will be valid for at least 1 hour.
--- When the link expires, a new one can be requested by calling getFile.
-data File = File
-  { fileFileId   :: FileId -- ^ Unique identifier for this file
-  , fileFileSize :: Maybe Int32 -- ^ File size, if known
-  , fileFilePath :: Maybe Text -- ^ File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
-  }
-  deriving (Generic, Show)
-
--- ** 'ReplyKeyboardMarkup'
-
--- | This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
-data ReplyKeyboardMarkup = ReplyKeyboardMarkup
-  { replyKeyboardMarkupKeyboard        :: [[KeyboardButton]] -- ^ Array of button rows, each represented by an Array of KeyboardButton objects
-  , replyKeyboardMarkupResizeKeyboard  :: Maybe Bool -- ^ Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
-  , replyKeyboardMarkupOneTimeKeyboard :: Maybe Bool -- ^ Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
-  , replyKeyboardMarkupSelective       :: Maybe Bool -- ^ Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
-  }
-  deriving (Generic, Show)
-
--- ** 'KeyboardButton'
-
--- | This object represents one button of the reply keyboard.
--- For simple text buttons String can be used instead of this object
--- to specify text of the button. Optional fields are mutually exclusive.
-data KeyboardButton = KeyboardButton
-  { keyboardButtonText            :: Text -- ^ Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
-  , keyboardButtonRequestContact  :: Maybe Bool -- ^ If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
-  , keyboardButtonRequestLocation :: Maybe Bool -- ^ If True, the user's current location will be sent when the button is pressed. Available in private chats only
-  }
-  deriving (Generic, Show)
-
-instance IsString KeyboardButton where
-  fromString s = KeyboardButton (fromString s) Nothing Nothing
-
--- ** 'ReplyKeyboardRemove'
-
--- | Upon receiving a message with this object,
--- Telegram clients will remove the current custom keyboard
--- and display the default letter-keyboard.
---
--- By default, custom keyboards are displayed until a new keyboard is sent by a bot.
--- An exception is made for one-time keyboards that are hidden immediately after
--- the user presses a button (see 'ReplyKeyboardMarkup').
-data ReplyKeyboardRemove = ReplyKeyboardRemove
-  { replyKeyboardRemoveRemoveKeyboard :: Bool -- ^ Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
-  , replyKeyboardRemoveSelective      :: Maybe Bool -- ^ Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
-  }
-  deriving (Generic, Show)
-
--- ** 'InlineKeyboardMarkup'
-
--- | This object represents an inline keyboard that appears
--- right next to the message it belongs to.
-data InlineKeyboardMarkup = InlineKeyboardMarkup
-  { inlineKeyboardMarkupInlineKeyboard :: [[InlineKeyboardButton]] -- ^ Array of button rows, each represented by an Array of InlineKeyboardButton objects
-  }
-  deriving (Generic, Show)
-
--- ** 'InlineKeyboardButton'
-
--- | This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
-data InlineKeyboardButton = InlineKeyboardButton
-  { inlineKeyboardButtonText              :: Text -- ^ Label text on the button
-  , inlineKeyboardButtonUrl               :: Maybe Text -- ^ HTTP url to be opened when button is pressed
-  , inlineKeyboardButtonCallbackData      :: Maybe Text -- ^ Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
-  , inlineKeyboardButtonSwitchInlineQuery :: Maybe Text -- ^ If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.
-  , inlineKeyboardButtonSwitchInlineQueryCurrentChat :: Maybe Text -- ^ If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted.
-
---  , inlineKeyboardButtonCallbackGame :: Maybe CallbackGame -- ^ Description of the game that will be launched when the user presses the button.
-  , inlineKeyboardButtonPay               :: Maybe Bool -- ^ Specify True, to send a Pay button.
-  }
-  deriving (Generic, Show)
-
-labeledInlineKeyboardButton :: Text -> InlineKeyboardButton
-labeledInlineKeyboardButton label = InlineKeyboardButton label Nothing Nothing Nothing Nothing Nothing
-
--- ** 'CallbackQuery'
-
--- | This object represents an incoming callback query from a callback button
--- in an inline keyboard. If the button that originated the query was attached
--- to a message sent by the bot, the field message will be present.
--- If the button was attached to a message sent via the bot (in inline mode),
--- the field @inline_message_id@ will be present.
--- Exactly one of the fields data or game_short_name will be present.
-data CallbackQuery = CallbackQuery
-  { callbackQueryId              :: CallbackQueryId -- ^ Unique identifier for this query
-  , callbackQueryFrom            :: User -- ^ Sender
-  , callbackQueryMessage         :: Maybe Message -- ^ Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old
-  , callbackQueryInlineMessageId :: Maybe MessageId -- ^ Identifier of the message sent via the bot in inline mode, that originated the query.
-  , callbackQueryChatInstance    :: Text -- ^ Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
-  , callbackQueryData            :: Maybe Text -- ^ Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.
-  , callbackQueryGameShortName   :: Maybe Text -- ^ Short name of a Game to be returned, serves as the unique identifier for the game
-  }
-  deriving (Generic, Show)
-
-newtype CallbackQueryId = CallbackQueryId Text
-  deriving (Eq, Show, Generic, ToJSON, FromJSON)
-
--- ** 'ForceReply'
-
--- | Upon receiving a message with this object,
--- Telegram clients will display a reply interface to the user
--- (act as if the user has selected the bot‘s message and tapped ’Reply').
--- This can be extremely useful if you want to create user-friendly
--- step-by-step interfaces without having to sacrifice privacy mode.
-data ForceReply = ForceReply
-  { forceReplyForceReply :: Bool -- ^ Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply'
-  , forceReplySelective  :: Maybe Bool -- ^ Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
-  }
-  deriving (Generic, Show)
-
--- ** Chat photo
-
--- | Chat photo. Returned only in getChat.
-data ChatPhoto = ChatPhoto
-  { chatPhotoSmallFileId :: FileId -- ^ Unique file identifier of small (160x160) chat photo. This file_id can be used only for photo download.
-  , chatPhotoBigFileId   :: FileId -- ^ Unique file identifier of big (640x640) chat photo. This file_id can be used only for photo download.
-  }
-  deriving (Generic, Show)
-
--- ** 'ChatMember'
-
--- | This object contains information about one member of a chat.
-data ChatMember = ChatMember
-  { chatMemberUser                  :: User -- ^ Information about the user
-  , chatMemberStatus                :: Text -- ^ The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”
-  , chatMemberUntilDate             :: Maybe POSIXTime -- ^ Restictred and kicked only. Date when restrictions will be lifted for this user, unix time
-  , chatMemberCanBeEdited           :: Maybe Bool -- ^ Administrators only. True, if the bot is allowed to edit administrator privileges of that user
-  , chatMemberCanChangeInfo         :: Maybe Bool -- ^ Administrators only. True, if the administrator can change the chat title, photo and other settings
-  , chatMemberCanPostMessages       :: Maybe Bool -- ^ Administrators only. True, if the administrator can post in the channel, channels only
-  , chatMemberCanEditMessages       :: Maybe Bool -- ^ Administrators only. True, if the administrator can edit messages of other users and can pin messages, channels only
-  , chatMemberCanDeleteMessages     :: Maybe Bool -- ^ Administrators only. True, if the administrator can delete messages of other users
-  , chatMemberCanInviteUsers        :: Maybe Bool -- ^ Administrators only. True, if the administrator can invite new users to the chat
-  , chatMemberCanRestrictMembers    :: Maybe Bool -- ^ Administrators only. True, if the administrator can restrict, ban or unban chat members
-  , chatMemberCanPinMessages        :: Maybe Bool -- ^ Administrators only. True, if the administrator can pin messages, supergroups only
-  , chatMemberCanPromoteMembers     :: Maybe Bool -- ^ Administrators only. True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
-  , chatMemberCanSendMessages       :: Maybe Bool -- ^ Restricted only. True, if the user can send text messages, contacts, locations and venues
-  , chatMemberCanSendMediaMessages  :: Maybe Bool -- ^ Restricted only. True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
-  , chatMemberCanSendOtherMessages  :: Maybe Bool -- ^ Restricted only. True, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages
-  , chatMemberCanAddWebPagePreviews :: Maybe Bool -- ^ Restricted only. True, if user may add web page previews to his messages, implies can_send_media_messages
-  }
-  deriving (Generic, Show)
-
--- ** 'ResponseParameters'
-
--- | Contains information about why a request was unsuccessful.
-data ResponseParameters = ResponseParameters
-  { responseParametersMigrateToChatId :: Maybe ChatId -- ^ The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
-  , responseParametersRetryAfter      :: Maybe Seconds -- ^ In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
-  }
-  deriving (Show, Generic)
-
-
-foldMap deriveJSON'
-  [ ''User
-  , ''Chat
-  , ''Message
-  , ''MessageEntity
-  , ''PhotoSize
-  , ''Audio
-  , ''Document
-  , ''Sticker
-  , ''Video
-  , ''Voice
-  , ''VideoNote
-  , ''Contact
-  , ''Location
-  , ''Venue
-  , ''UserProfilePhotos
-  , ''File
-  , ''ReplyKeyboardMarkup
-  , ''KeyboardButton
-  , ''ReplyKeyboardRemove
-  , ''InlineKeyboardMarkup
-  , ''InlineKeyboardButton
-  , ''CallbackQuery
-  , ''ForceReply
-  , ''ChatPhoto
-  , ''ChatMember
-  , ''ResponseParameters
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE DuplicateRecordFields #-}
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeApplications #-}
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE BlockArguments #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+module Telegram.Bot.API.Types where
+
+import Data.Aeson (ToJSON(..), FromJSON(..), Value(..), object, KeyValue ((.=)), withObject, (.:))
+import Data.Aeson.Types (Parser, Pair, Object)
+import Data.Aeson.Text (encodeToLazyText)
+import Data.Coerce (coerce)
+import Data.Int (Int32)
+import Data.Bool (bool)
+import Data.Maybe (catMaybes)
+import Data.Functor ((<&>))
+import Data.Hashable (Hashable)
+import Data.String
+import Data.Text (Text, pack)
+import qualified Data.Text as Text
+import qualified Data.Text.Lazy as TL
+import Data.Time.Clock.POSIX (POSIXTime)
+import GHC.Generics (Generic)
+import Servant.API
+import Servant.Multipart.API
+import System.FilePath
+
+import Telegram.Bot.API.Internal.Utils
+
+type RequiredQueryParam = QueryParam' '[Required , Strict]
+
+newtype Seconds = Seconds Int32
+  deriving (Eq, Show, Num, ToJSON, FromJSON)
+
+-- * Available types
+
+-- ** User
+
+-- | This object represents a Telegram user or bot.
+--
+-- <https://core.telegram.org/bots/api#user>
+data User = User
+  { userId           :: UserId     -- ^ Unique identifier for this user or bot.
+  , userIsBot        :: Bool       -- ^ 'True', if this user is a bot.
+  , userFirstName    :: Text       -- ^ User's or bot's first name.
+  , userLastName     :: Maybe Text -- ^ User‘s or bot’s last name.
+  , userUsername     :: Maybe Text -- ^ User‘s or bot’s username.
+  , userLanguageCode :: Maybe Text -- ^ IETF language tag of the user's language.
+  , userCanJoinGroups :: Maybe Bool -- ^ 'True', if the bot can be invited to groups. Returned only in `getMe`.
+  , userCanReadAllGroupMessages :: Maybe Bool -- ^ 'True', if privacy mode is disabled for the bot. Returned only in `getMe`.
+  , userSupportsInlineQueries :: Maybe Bool -- ^ 'True', if the bot supports inline queries. Returned only in `getMe`.
+  }
+  deriving (Show, Generic)
+
+-- | Unique identifier for this user or bot.
+newtype UserId = UserId Integer
+  deriving (Eq, Show, ToJSON, FromJSON)
+
+instance ToHttpApiData UserId where
+  toUrlPiece = pack . show @Integer . coerce
+
+-- ** Chat
+
+-- | This object represents a chat.
+--
+-- <https://core.telegram.org/bots/api#chat>
+data Chat = Chat
+  { chatId               :: ChatId          -- ^ Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
+  , chatType             :: ChatType        -- ^ Type of chat.
+  , chatTitle            :: Maybe Text      -- ^ Title, for supergroups, channels and group chats
+  , chatUsername         :: Maybe Text      -- ^ Username, for private chats, supergroups and channels if available
+  , chatFirstName        :: Maybe Text      -- ^ First name of the other party in a private chat
+  , chatLastName         :: Maybe Text      -- ^ Last name of the other party in a private chat
+  , chatPhoto            :: Maybe ChatPhoto -- ^ Chat photo. Returned only in getChat.
+  , chatBio              :: Maybe Text      -- ^ Bio of the other party in a private chat. Returned only in `getChat`.
+  , chatHasPrivateForwards :: Maybe Bool    -- ^ 'True', if privacy settings of the other party in the private chat allows to use `tg://user?id=<user_id>` links only in chats with the user. Returned only in getChat.
+  , chatDescription      :: Maybe Text      -- ^ Description, for supergroups and channel chats. Returned only in getChat.
+  , chatInviteLink       :: Maybe Text      -- ^ Chat invite link, for supergroups and channel chats. Returned only in getChat.
+  , chatPinnedMessage    :: Maybe Message   -- ^ Pinned message, for supergroups. Returned only in getChat.
+  , chatPermissions      :: Maybe ChatPermissions -- ^ Default chat member permissions, for groups and supergroups.
+  , chatSlowModeDelay    :: Maybe Int       -- ^ For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds.
+  , chatMessageAutoDeleteTime :: Maybe POSIXTime -- ^ The time after which all messages sent to the chat will be automatically deleted; in seconds.
+  , chatHasProtectedContent :: Maybe Bool   -- ^ 'True', if messages from the chat can't be forwarded to other chats.
+  , chatStickerSetName   :: Maybe Text      -- ^ For supergroups, name of group sticker set. Returned only in getChat.
+  , chatCanSetStickerSet :: Maybe Bool      -- ^ True, if the bot can change the group sticker set. Returned only in `getChat`.
+  , chatLinkedChatId     :: Maybe ChatId    -- ^ Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
+  , chatLocation         :: Maybe ChatLocation -- ^ For supergroups, the location to which the supergroup is connected. Returned only in getChat.
+  }
+  deriving (Generic, Show)
+
+-- | Unique identifier for this chat.
+newtype ChatId = ChatId Integer
+  deriving (Eq, Show, ToJSON, FromJSON, Hashable)
+
+instance ToHttpApiData ChatId where
+  toUrlPiece a = pack . show @Integer $ coerce a
+
+-- | Type of chat.
+data ChatType
+  = ChatTypePrivate
+  | ChatTypeGroup
+  | ChatTypeSupergroup
+  | ChatTypeChannel
+  deriving (Generic, Show)
+
+instance ToJSON   ChatType where
+  toJSON = gtoJSON
+instance FromJSON ChatType where
+  parseJSON = gparseJSON
+
+-- ** Message
+
+-- | This object represents a message.
+data Message = Message
+  { messageMessageId             :: MessageId -- ^ Unique message identifier inside this chat.
+  , messageFrom                  :: Maybe User -- ^ Sender, empty for messages sent to channels.
+  , messageSenderChat            :: Maybe Chat -- ^ Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
+  , messageDate                  :: POSIXTime -- ^ Date the message was sent in Unix time.
+  , messageChat                  :: Chat -- ^ Conversation the message belongs to.
+  , messageForwardFrom           :: Maybe User -- ^ For forwarded messages, sender of the original message.
+  , messageForwardFromChat       :: Maybe Chat -- ^ For messages forwarded from channels, information about the original channel.
+  , messageForwardFromMessageId  :: Maybe MessageId -- ^ For messages forwarded from channels, identifier of the original message in the channel.
+  , messageForwardSignature      :: Maybe Text -- ^ For messages forwarded from channels, signature of the post author if present.
+  , messageForwardSenderName     :: Maybe Text -- ^ Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages.
+  , messageForwardDate           :: Maybe POSIXTime -- ^ For forwarded messages, date the original message was sent in Unix time
+  , messageIsAutomaticForward    :: Maybe Bool -- ^ 'True', if the message is a channel post that was automatically forwarded to the connected discussion group.
+  , messageReplyToMessage        :: Maybe Message -- ^ For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
+  , messageViaBot                :: Maybe User -- ^ Bot through which the message was sent.
+  , messageEditDate              :: Maybe POSIXTime -- ^ Date the message was last edited in Unix time
+  , messageHasProtectedContent   :: Maybe Bool -- ^ 'True', if the message can't be forwarded.
+  , messageMediaGroupId          :: Maybe MediaGroupId -- ^ The unique identifier of a media message group this message belongs to
+  , messageAuthorSignature       :: Maybe Text -- ^ Signature of the post author for messages in channels
+  , messageText                  :: Maybe Text -- ^ For text messages, the actual UTF-8 text of the message, 0-4096 characters.
+  , messageEntities              :: Maybe [MessageEntity] -- ^ For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
+  , messageAnimation             :: Maybe Animation -- ^ Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.
+  , messageAudio                 :: Maybe Audio -- ^ Message is an audio file, information about the file
+  , messageDocument              :: Maybe Document -- ^ Message is a general file, information about the file.
+  , messagePhoto                 :: Maybe [PhotoSize] -- ^ Message is a photo, available sizes of the photo
+  , messageSticker               :: Maybe Sticker -- ^ Message is a sticker, information about the sticker
+  , messageVideo                 :: Maybe Video -- ^ Message is a video, information about the video
+  , messageVideoNote             :: Maybe VideoNote -- ^ Message is a video note, information about the video message
+  , messageVoice                 :: Maybe Voice -- ^ Message is a voice message, information about the file
+  , messageCaption               :: Maybe Text -- ^ Caption for the audio, document, photo, video or voice, 0-200 characters
+  , messageCaptionEntities       :: Maybe [MessageEntity] -- ^ For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
+  , messageContact               :: Maybe Contact -- ^ Message is a shared contact, information about the contact
+  , messageDice                  :: Maybe Dice -- ^ Message is a dice with random value.
+  , messageGame                  :: Maybe Game -- ^ Message is a game, information about the game. More about games »  , messageLocation              :: Maybe Location -- ^ Message is a shared location, information about the location
+  , messagePoll                  :: Maybe Poll -- ^ Message is a native poll, information about the poll.
+  , messageVenue                 :: Maybe Venue -- ^ Message is a venue, information about the venue
+  , messageLocation              :: Maybe Location -- ^ Message is a shared location, information about the location.
+  , messageNewChatMembers        :: Maybe [User] -- ^ New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
+  , messageLeftChatMember        :: Maybe User -- ^ A member was removed from the group, information about them (this member may be the bot itself)
+  , messageNewChatTitle          :: Maybe Text -- ^ A chat title was changed to this value
+  , messageNewChatPhoto          :: Maybe [PhotoSize] -- ^ A chat photo was change to this value
+  , messageDeleteChatPhoto       :: Maybe Bool -- ^ Service message: the chat photo was deleted
+  , messageGroupChatCreated      :: Maybe Bool -- ^ Service message: the group has been created
+  , messageSupergroupChatCreated :: Maybe Bool -- ^ Service message: the supergroup has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
+  , messageChannelChatCreated    :: Maybe Bool -- ^ Service message: the channel has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
+  , messageAutoDeleteTimerChanged :: Maybe MessageAutoDeleteTimerChanged -- ^ Service message: auto-delete timer settings changed in the chat.
+  , messageMigrateToChatId       :: Maybe ChatId -- ^ The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
+  , messageMigrateFromChatId     :: Maybe ChatId -- ^ The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
+  , messagePinnedMessage         :: Maybe Message -- ^ Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
+  , messageInvoice               :: Maybe Invoice -- ^ Message is an invoice for a payment, information about the invoice.
+  , messageSuccessfulPayment     :: Maybe SuccessfulPayment -- ^ Message is a service message about a successful payment, information about the payment.
+  , messageConnectedWebsite      :: Maybe Text -- ^ The domain name of the website on which the user has logged in.
+  , messagePassportData          :: Maybe PassportData -- ^ Telegram Passport data.
+  , messageProximityAlertTriggered :: Maybe ProximityAlertTriggered -- ^ Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
+  , messageVoiceChatScheduled    :: Maybe VoiceChatScheduled -- ^ Service message: voice chat scheduled.
+  , messageVoiceChatStarted      :: Maybe VoiceChatStarted -- ^ Service message: voice chat started
+  , messageVoiceChatEnded        :: Maybe VoiceChatEnded -- ^ Service message: voice chat ended.
+  , messageVoiceChatParticipantsInvited :: Maybe VoiceChatParticipantsInvited -- ^ Service message: new participants invited to a voice chat.
+  , messageReplyMarkup           :: Maybe InlineKeyboardMarkup -- ^ Inline keyboard attached to the message. `login_url` buttons are represented as ordinary `url` buttons.
+  }
+  deriving (Generic, Show)
+
+-- | Unique message identifier inside this chat.
+newtype MessageId = MessageId Integer
+  deriving (Eq, Show, ToJSON, FromJSON, Hashable)
+
+instance ToHttpApiData MessageId where
+  toUrlPiece a = pack . show @Integer $ coerce a
+
+-- | The unique identifier of a media message group a message belongs to.
+newtype MediaGroupId = MediaGroupId Text
+  deriving (Eq, Show, ToJSON, FromJSON)
+
+-- ** MessageEntity
+
+-- | This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
+data MessageEntity = MessageEntity
+  { messageEntityType   :: MessageEntityType -- ^ Type of the entity. Can be mention (@username), hashtag, bot_command, url, email, bold (bold text), italic (italic text), underline (underlined text), strikethrough, code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames)
+  , messageEntityOffset :: Int32 -- ^ Offset in UTF-16 code units to the start of the entity
+  , messageEntityLength :: Int32 -- ^ Length of the entity in UTF-16 code units
+  , messageEntityUrl    :: Maybe Text -- ^ For “text_link” only, url that will be opened after user taps on the text
+  , messageEntityUser   :: Maybe User -- ^ For “text_mention” only, the mentioned user
+  , messageEntityLanguage :: Maybe Text -- ^ For “pre” only, the programming language of the entity text.
+  }
+  deriving (Generic, Show)
+
+-- | Type of the entity. Can be mention (@username), hashtag, bot_command, url, email, bold (bold text), italic (italic text), underline (underlined text), strikethrough, code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames), cashtag, phone_number
+data MessageEntityType
+  = MessageEntityMention
+  | MessageEntityHashtag
+  | MessageEntityBotCommand
+  | MessageEntityUrl
+  | MessageEntityEmail
+  | MessageEntityBold
+  | MessageEntityItalic
+  | MessageEntityUnderline -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_underline.html>
+  | MessageEntityStrikethrough -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_strikethrough.html>
+  | MessageEntityCode
+  | MessageEntityPre
+  | MessageEntityTextLink
+  | MessageEntityTextMention
+  | MessageEntityCashtag -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_cashtag.html>.
+  | MessageEntityPhoneNumber -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_phone_number.html>.
+  deriving (Eq, Show, Generic)
+
+instance ToJSON   MessageEntityType where
+  toJSON = gtoJSON
+instance FromJSON MessageEntityType where
+  parseJSON = gparseJSON
+
+-- ** 'PhotoSize'
+
+-- | This object represents one size of a photo or a file / sticker thumbnail.
+data PhotoSize = PhotoSize
+  { photoSizeFileId       :: FileId      -- ^ Unique identifier for this file.
+  , photoSizeFileUniqueId :: FileId      -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  , photoSizeWidth        :: Int32       -- ^ Photo width
+  , photoSizeHeight       :: Int32       -- ^ Photo height
+  , photoSizeFileSize     :: Maybe Int32 -- ^ File size
+  }
+  deriving (Generic, Show)
+
+-- | Unique identifier for this file.
+newtype FileId = FileId Text
+  deriving (Eq, Show, ToJSON, FromJSON)
+
+instance ToHttpApiData FileId where
+  toUrlPiece = coerce
+
+-- ** 'Animation'
+
+-- | This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
+data Animation = Animation
+  { animationFileId       :: FileId          -- ^ Identifier for this file, which can be used to download or reuse the file.
+  , animationFileUniqueId :: FileId          -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  , animationWidth        :: Int32           -- ^ Video width as defined by sender.
+  , animationHeight       :: Int32           -- ^ Video height as defined by sender.
+  , animationDuration     :: Seconds         -- ^ Duration of the video in seconds as defined by sender.
+  , animationThumb        :: Maybe PhotoSize -- ^ Animation thumbnail as defined by sender.
+  , animationFileName     :: Maybe Text      -- ^ Original animation filename as defined by sender.
+  , animationMimeType     :: Maybe Text      -- ^ MIME type of the file as defined by sender.
+  , animationFileSize     :: Maybe Int32     -- ^ File size in bytes.
+  }
+  deriving (Generic, Show)
+
+-- ** 'Audio'
+
+-- | This object represents an audio file to be treated as music by the Telegram clients.
+data Audio = Audio
+  { audioFileId    :: FileId -- ^ Unique identifier for this file.
+  , audioFileUniqueId :: FileId -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  , audioDuration  :: Seconds -- ^ Duration of the audio in seconds as defined by sender.
+  , audioPerformer :: Maybe Text -- ^ Performer of the audio as defined by sender or by audio tags.
+  , audioTitle     :: Maybe Text -- ^ Title of the audio as defined by sender or by audio tags.
+  , audioFileName  :: Maybe Text -- ^ Original filename as defined by sender.
+  , audioMimeType  :: Maybe Text -- ^ MIME type of the file as defined by sender.
+  , audioFileSize  :: Maybe Int32 -- ^ File size in bytes.
+  , audioThumb     :: Maybe PhotoSize -- ^ Thumbnail of the album cover to which the music file belongs.
+  }
+  deriving (Generic, Show)
+
+-- ** 'Document'
+
+-- | This object represents a general file (as opposed to photos, voice messages and audio files).
+data Document = Document
+  { documentFileId   :: FileId -- ^ Unique file identifier.
+  , documentFileUniqueId :: FileId -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  , documentThumb    :: Maybe PhotoSize -- ^ Document thumbnail as defined by sender.
+  , documentFileName :: Maybe Text -- ^ Original filename as defined by sender.
+  , documentMimeType :: Maybe Text -- ^ MIME type of the file as defined by sender.
+  , documentFileSize :: Maybe Int32 -- ^ File size in bytes. 
+  }
+  deriving (Generic, Show)
+
+-- ** 'Video'
+
+-- | This object represents a video file.
+data Video = Video
+  { videoFileId       :: FileId -- ^ Unique identifier for this file.
+  , videoFileUniqueId :: FileId -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  , videoWidth        :: Int32 -- ^ Video width as defined by sender.
+  , videoHeight       :: Int32 -- ^ Video height as defined by sender.
+  , videoDuration     :: Seconds -- ^ Duration of the video in seconds as defined by sender.
+  , videoThumb        :: Maybe PhotoSize -- ^ Video thumbnail.
+  , videoFileName     :: Maybe Text -- ^ Original filename as defined by sender.
+  , videoMimeType     :: Maybe Text -- ^ Mime type of a file as defined by sender.
+  , videoFileSize     :: Maybe Int32 -- ^ File size in bytes.
+  }
+  deriving (Generic, Show)
+
+-- ** 'VideoNote'
+
+-- | This object represents a video message (available in Telegram apps as of v.4.0).
+data VideoNote = VideoNote
+  { videoNoteFileId   :: FileId -- ^ Unique identifier for this file.
+  , videoNoteFileUniqueId :: FileId -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  , videoNoteLength   :: Int32 -- ^ Video width and height as defined by sender.
+  , videoNoteDuration :: Seconds -- ^ Duration of the video in seconds as defined by sender.
+  , videoNoteThumb    :: Maybe PhotoSize -- ^ Video thumbnail.
+  , videoNoteFileSize :: Maybe Int32 -- ^ File size in bytes.
+  }
+  deriving (Generic, Show)
+
+-- ** 'Voice'
+
+-- | This object represents a voice note.
+data Voice = Voice
+  { voiceFileId   :: FileId -- ^ Unique identifier for this file.
+  , voiceFileUniqueId :: FileId -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  , voiceDuration :: Seconds -- ^ Duration of the audio in seconds as defined by sender.
+  , voiceMimeType :: Maybe Text -- ^ MIME type of the file as defined by sender.
+  , voiceFileSize :: Maybe Int32 -- ^ File size in bytes.
+  }
+  deriving (Generic, Show)
+
+-- ** 'Contact'
+
+-- | This object represents a phone contact.
+data Contact = Contact
+  { contactPhoneNumber :: Text -- ^ Contact's phone number.
+  , contactFirstName   :: Text -- ^ Contact's first name.
+  , contactLastName    :: Maybe Text -- ^ Contact's last name.
+  , contactUserId      :: Maybe UserId -- ^ Contact's user identifier in Telegram.
+  , contactVcard       :: Maybe Text -- ^ Additional data about the contact in the form of a vCard.
+  }
+  deriving (Generic, Show)
+
+-- ** 'Dice'
+
+-- | This object represents an animated emoji that displays a random value.
+data Dice = Dice
+  { diceEmoji :: Text -- ^ Emoji on which the dice throw animation is based.
+  , diceValue :: Int  -- ^ Value of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji
+  }
+  deriving (Generic, Show)
+
+-- ** 'PollOption'
+
+-- | This object contains information about one answer option in a poll.
+data PollOption = PollOption
+  { pollOptionText       :: Text -- ^ Option text, 1-100 characters.
+  , pollOptionVoterCount :: Int  -- ^ Number of users that voted for this option.
+  }
+  deriving (Generic, Show)
+
+-- ** 'PollAnswer'
+
+-- | This object represents an answer of a user in a non-anonymous poll.
+data PollAnswer = PollAnswer
+  { pollAnswerPollId    :: PollId -- ^ Unique poll identifier.
+  , pollAnswerUser      :: User   -- ^ The user, who changed the answer to the poll.
+  , pollAnswerOptionIds :: [Int]  -- ^ 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
+  }
+  deriving (Generic, Show)
+
+-- | Unique poll identifier.
+newtype PollId = PollId Text
+  deriving (Eq, Show, ToJSON, FromJSON)
+
+-- ** 'Poll'
+
+data Poll = Poll
+  { pollId                    :: PollId                -- ^ Unique poll identifier.
+  , pollQuestion              :: Text                  -- ^ Poll question, 1-300 characters.
+  , pollOptions               :: [PollOption]          -- ^ List of poll options.
+  , pollTotalVoterCount       :: Int32                 -- ^ Total number of users that voted in the poll.
+  , pollIsClosed              :: Bool                  -- ^ 'True', if the poll is closed.
+  , pollIsAnonymous           :: Bool                  -- ^ 'True', if the poll is anonymous.
+  , pollType                  :: PollType              -- ^ Poll type, currently can be “regular” or “quiz”.
+  , pollAllowsMultipleAnswers :: Bool                  -- ^ 'True', if the poll allows multiple answers.
+  , pollCorrectOptionId       :: Maybe Int             -- ^ 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
+  , pollExplanation           :: Maybe Text            -- ^ Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters.
+  , pollExplanationEntities   :: Maybe [MessageEntity] -- ^ Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.
+  , pollOpenPeriod            :: Maybe Seconds         -- ^ Amount of time in seconds the poll will be active after creation.
+  , pollCloseData             :: Maybe POSIXTime       -- ^ Point in time (Unix timestamp) when the poll will be automatically closed.
+  }
+  deriving (Generic, Show)
+
+-- ** Location
+
+-- | This object represents a point on the map.
+data Location = Location
+  { locationLongitude            :: Float         -- ^ Longitude as defined by sender.
+  , locationLatitude             :: Float         -- ^ Latitude as defined by sender.
+  , locationHorizontalAccuracy   :: Maybe Float   -- ^ The radius of uncertainty for the location, measured in meters; 0-1500.
+  , locationLivePeriod           :: Maybe Seconds -- ^ Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.
+  , locationHeading              :: Maybe Int     -- ^ The direction in which user is moving, in degrees; 1-360. For active live locations only.
+  , locationProximityAlertRadius :: Maybe Int     -- ^ Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.
+  }
+  deriving (Generic, Show)
+
+-- ** 'Venue'
+
+-- | This object represents a venue.
+data Venue = Venue
+  { venueLocation        :: Location   -- ^ Venue location.
+  , venueTitle           :: Text       -- ^ Name of the venue.
+  , venueAddress         :: Text       -- ^ Address of the venue.
+  , venueFoursquareId    :: Maybe Text -- ^ Foursquare identifier of the venue.
+  , venueFoursquareType  :: Maybe Text -- ^ Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
+  , venueGooglePlaceId   :: Maybe Text -- ^ Google Places identifier of the venue.
+  , venueGooglePlaceType :: Maybe Text -- ^ Google Places type of the venue. (See supported types.)
+  }
+  deriving (Generic, Show)
+
+-- ** 'ProximityAlertTriggered'
+
+-- | This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
+data ProximityAlertTriggered = ProximityAlertTriggered
+  { proximityAlertTriggeredTraveler :: User  -- ^ User that triggered the alert.
+  , proximityAlertTriggeredWatcher  :: User  -- ^ User that set the alert.
+  , proximityAlertTriggeredDistance :: Int32 -- ^ The distance between the users.
+  }
+  deriving (Generic, Show)
+
+-- ** 'MessageAutoDeleteTimerChanged'
+
+-- | This object represents a service message about a change in auto-delete timer settings.
+data MessageAutoDeleteTimerChanged = MessageAutoDeleteTimerChanged
+  { messageAutoDeleteTimerChangedMessageAutoDeleteTime :: Seconds -- ^ New auto-delete time for messages in the chat; in seconds
+  }
+  deriving (Generic, Show)
+
+-- ** 'VoiceChatScheduled'
+
+-- | This object represents a service message about a voice chat scheduled in the chat.
+data VoiceChatScheduled = VoiceChatScheduled
+  { voiceChatScheduledStartDate :: POSIXTime -- ^ Point in time (Unix timestamp) when the voice chat is supposed to be started by a chat administrator.
+  }
+  deriving (Generic, Show)
+
+-- ** 'VoiceChatStarted'
+
+-- | This object represents a service message about a voice chat started in the chat. Currently holds no information.
+data VoiceChatStarted = VoiceChatStarted
+  deriving (Generic, Show)
+
+-- ** 'VoiceChatEnded'
+
+-- | This object represents a service message about a voice chat ended in the chat.
+data VoiceChatEnded = VoiceChatEnded
+  { voiceChatEndedDuration :: Seconds -- ^ Voice chat duration in seconds.
+  }
+  deriving (Generic, Show)
+
+-- ** 'VoiceChatParticipantsInvited'
+data VoiceChatParticipantsInvited = VoiceChatParticipantsInvited
+  { voiceChatParticipantsInvitedUsers :: Maybe [User] -- ^ New members that were invited to the voice chat.
+  }
+  deriving (Generic, Show)
+
+-- ** 'UserProfilePhotos'
+
+-- | This object represent a user's profile pictures.
+data UserProfilePhotos = UserProfilePhotos
+  { userProfilePhotosTotalCount :: Int32 -- ^ Total number of profile pictures the target user has
+  , userProfilePhotosPhotos     :: [[PhotoSize]] -- ^ Requested profile pictures (in up to 4 sizes each)
+  }
+  deriving (Generic, Show)
+
+-- ** 'File'
+
+-- | This object represents a file ready to be downloaded.
+-- The file can be downloaded via the link @https://api.telegram.org/file/bot<token>/<file_path>@.
+-- It is guaranteed that the link will be valid for at least 1 hour.
+-- When the link expires, a new one can be requested by calling getFile.
+data File = File
+  { fileFileId       :: FileId      -- ^ Unique identifier for this file.
+  , fileFileUniqueId :: FileId      -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  , fileFileSize     :: Maybe Int32 -- ^ File size in bytes, if known.
+  , fileFilePath     :: Maybe Text  -- ^ File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
+  }
+  deriving (Generic, Show)
+
+type ContentType = Text
+
+data InputFile
+  = InputFileId FileId
+  | FileUrl Text
+  | InputFile FilePath ContentType
+
+instance ToJSON InputFile where
+  toJSON (InputFileId i) = toJSON i
+  toJSON (FileUrl t) = toJSON t
+  toJSON (InputFile f _) = toJSON ("attach://" <> pack (takeFileName f))
+
+-- | Multipart file helper
+makeFile :: Text -> InputFile ->  MultipartData Tmp ->  MultipartData Tmp
+makeFile name (InputFile path ct) (MultipartData fields files) = 
+  MultipartData 
+    (Input name ("attach://" <> name) : fields) 
+    (FileData name (pack $ takeFileName path) ct path : files)
+
+makeFile name file (MultipartData fields files) = 
+  MultipartData 
+    (Input name (TL.toStrict $ encodeToLazyText file) : fields) 
+    files
+
+-- ** 'ReplyKeyboardMarkup'
+
+-- | This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
+data ReplyKeyboardMarkup = ReplyKeyboardMarkup
+  { replyKeyboardMarkupKeyboard           :: [[KeyboardButton]] -- ^ Array of button rows, each represented by an Array of KeyboardButton objects
+  , replyKeyboardMarkupResizeKeyboard     :: Maybe Bool         -- ^ Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
+  , replyKeyboardMarkupOneTimeKeyboard    :: Maybe Bool         -- ^ Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
+  , replyKeyboardMarkupInputFieldSelector :: Maybe Text         -- ^ The placeholder to be shown in the input field when the keyboard is active; 1-64 characters.
+  , replyKeyboardMarkupSelective          :: Maybe Bool         -- ^ Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
+    --
+    -- Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.
+  }
+  deriving (Generic, Show)
+
+-- ** 'KeyboardButton'
+
+-- | This object represents one button of the reply keyboard.
+-- For simple text buttons String can be used instead of this object
+-- to specify text of the button. Optional fields are mutually exclusive.
+data KeyboardButton = KeyboardButton
+  { keyboardButtonText            :: Text       -- ^ Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed.
+  , keyboardButtonRequestContact  :: Maybe Bool -- ^ If 'True', the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.
+  , keyboardButtonRequestLocation :: Maybe Bool -- ^ If 'True', the user's current location will be sent when the button is pressed. Available in private chats only.
+  , keyboardButtonRequestPoll     :: Maybe PollType -- ^ If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only.
+  }
+  deriving (Generic, Show)
+
+instance IsString KeyboardButton where
+  fromString s = KeyboardButton (fromString s) Nothing Nothing Nothing
+
+data PollType =
+  PollTypeQuiz | PollTypeRegular
+  deriving (Generic, Show)
+
+getPollType :: PollType -> Text
+getPollType PollTypeQuiz = "quiz"
+getPollType PollTypeRegular = "regular"
+
+instance ToJSON PollType where
+  toJSON = String . getPollType
+
+instance FromJSON PollType where parseJSON = gparseJSON
+
+-- ** 'ReplyKeyboardRemove'
+
+-- | Upon receiving a message with this object,
+-- Telegram clients will remove the current custom keyboard
+-- and display the default letter-keyboard.
+--
+-- By default, custom keyboards are displayed until a new keyboard is sent by a bot.
+-- An exception is made for one-time keyboards that are hidden immediately after
+-- the user presses a button (see 'ReplyKeyboardMarkup').
+data ReplyKeyboardRemove = ReplyKeyboardRemove
+  { replyKeyboardRemoveRemoveKeyboard :: Bool -- ^ Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
+  , replyKeyboardRemoveSelective      :: Maybe Bool -- ^ Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
+  --
+  -- Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.
+  }
+  deriving (Generic, Show)
+
+-- ** 'InlineKeyboardMarkup'
+
+-- | This object represents an inline keyboard that appears
+-- right next to the message it belongs to.
+data InlineKeyboardMarkup = InlineKeyboardMarkup
+  { inlineKeyboardMarkupInlineKeyboard :: [[InlineKeyboardButton]] -- ^ Array of button rows, each represented by an Array of InlineKeyboardButton objects
+  }
+  deriving (Generic, Show)
+-- ^ 
+-- **Note**: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
+
+-- ** 'InlineKeyboardButton'
+
+-- | This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
+data InlineKeyboardButton = InlineKeyboardButton
+  { inlineKeyboardButtonText              :: Text -- ^ Label text on the button
+  , inlineKeyboardButtonUrl               :: Maybe Text -- ^ HTTP url to be opened when button is pressed
+  , inlineKeyboardButtonCallbackData      :: Maybe Text -- ^ Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
+  , inlineKeyboardButtonSwitchInlineQuery :: Maybe Text -- ^ If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.
+  , inlineKeyboardButtonSwitchInlineQueryCurrentChat :: Maybe Text -- ^ If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted.
+
+  , inlineKeyboardButtonCallbackGame      :: Maybe CallbackGame -- ^ Description of the game that will be launched when the user presses the button.
+  , inlineKeyboardButtonPay               :: Maybe Bool -- ^ Specify True, to send a Pay button.
+  }
+  deriving (Generic, Show)
+
+labeledInlineKeyboardButton :: Text -> InlineKeyboardButton
+labeledInlineKeyboardButton label = InlineKeyboardButton label Nothing Nothing Nothing Nothing Nothing Nothing
+
+-- ** 'LoginUrl'
+
+-- | This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:
+--
+-- https://core.telegram.org/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c
+--
+-- Telegram apps support these buttons as of version 5.7.
+data LoginUrl = LoginUrl
+  { loginUrlUrl                :: Text       -- ^ An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.
+  --
+  -- **NOTE**: You **must** always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
+  , loginUrlForwardText        :: Maybe Text -- ^ New text of the button in forwarded messages.
+  , loginUrlBotUsername        :: Maybe Text -- ^ Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
+  , loginUrlRequestWriteAccess :: Maybe Bool -- ^ Pass 'True' to request the permission for your bot to send messages to the user.
+  }
+  deriving (Generic, Show)
+
+-- ** 'CallbackQuery'
+
+-- | This object represents an incoming callback query from a callback button
+-- in an inline keyboard. If the button that originated the query was attached
+-- to a message sent by the bot, the field message will be present.
+-- If the button was attached to a message sent via the bot (in inline mode),
+-- the field @inline_message_id@ will be present.
+-- Exactly one of the fields data or game_short_name will be present.
+data CallbackQuery = CallbackQuery
+  { callbackQueryId              :: CallbackQueryId -- ^ Unique identifier for this query
+  , callbackQueryFrom            :: User -- ^ Sender
+  , callbackQueryMessage         :: Maybe Message -- ^ Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old
+  , callbackQueryInlineMessageId :: Maybe MessageId -- ^ Identifier of the message sent via the bot in inline mode, that originated the query.
+  , callbackQueryChatInstance    :: Text -- ^ Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
+  , callbackQueryData            :: Maybe Text -- ^ Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.
+  , callbackQueryGameShortName   :: Maybe Text -- ^ Short name of a Game to be returned, serves as the unique identifier for the game
+  }
+  deriving (Generic, Show)
+
+newtype CallbackQueryId = CallbackQueryId Text
+  deriving (Eq, Show, Generic, ToJSON, FromJSON)
+
+-- ** 'ForceReply'
+
+-- | Upon receiving a message with this object,
+-- Telegram clients will display a reply interface to the user
+-- (act as if the user has selected the bot‘s message and tapped ’Reply').
+-- This can be extremely useful if you want to create user-friendly
+-- step-by-step interfaces without having to sacrifice privacy mode.
+data ForceReply = ForceReply
+  { forceReplyForceReply            :: Bool       -- ^ Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply'
+  , forceReplyInputFieldPlaceholder :: Maybe Text -- ^ The placeholder to be shown in the input field when the reply is active; 1-64 characters.
+  , forceReplySelective             :: Maybe Bool -- ^ Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
+  }
+  deriving (Generic, Show)
+
+-- ** Chat photo
+
+-- | Chat photo. Returned only in getChat.
+data ChatPhoto = ChatPhoto
+  { chatPhotoSmallFileId       :: FileId -- ^ Unique file identifier of small (160x160) chat photo. This file_id can be used only for photo download.
+  , chatPhotoSmallFileUniqueId :: FileId -- ^ Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  , chatPhotoBigFileId         :: FileId -- ^ Unique file identifier of big (640x640) chat photo. This file_id can be used only for photo download.
+  , chatPhotoBigFileUniqueId   :: FileId -- ^ Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  }
+  deriving (Generic, Show)
+
+-- ** 'ChatInviteLink'
+
+-- | Represents an invite link for a chat.
+data ChatInviteLink = ChatInviteLink
+  { chatInviteLinkInviteLink              :: Text            -- ^ The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.
+  , chatInviteLinkCreator                 :: User            -- ^ Creator of the link.
+  , chatInviteLinkCreatesJoinRequest      :: Bool            -- ^ 'True', if users joining the chat via the link need to be approved by chat administrators.
+  , chatInviteLinkIsPrimary               :: Bool            -- ^ 'True', if the link is primary.
+  , chatInviteLinkIsRevoked               :: Bool            -- ^ 'True', if the link is revoked.
+  , chatInviteLinkName                    :: Maybe Text      -- ^ Invite link name.
+  , chatInviteLinkExpireDate              :: Maybe POSIXTime -- ^ Point in time (Unix timestamp) when the link will expire or has been expired.
+  , chatInviteLinkMemberLimit             :: Maybe Int32     -- ^ Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999.
+  , chatInviteLinkPendingJoinRequestCount :: Maybe Int32     -- ^ Number of pending join requests created using this link.
+  }
+  deriving (Generic, Show)
+
+
+
+-- ** 'ChatMember'
+
+-- | This object contains information about one member of a chat.
+data ChatMember = ChatMember
+  { chatMemberUser                  :: User -- ^ Information about the user
+  , chatMemberStatus                :: Text -- ^ The member's status in the chat. Can be “owner”, “administrator”, “member”, “restricted”, “left” or “banned”.
+
+  -- banned, restricted
+  , chatMemberUntilDate             :: Maybe POSIXTime -- ^ Restictred and banned only. Date when restrictions will be lifted for this user, unix time.
+
+  -- owner, administrator
+  , chatMemberIsAnonymous           :: Maybe Bool -- ^ Owners and administrators only. 'True', if the user's presence in the chat is hidden.
+  , chatMemberCustomTitle           :: Maybe Text -- ^ Owners and administrators only. Custom title for this user.
+
+  -- administrator
+  , chatMemberCanBeEdited           :: Maybe Bool -- ^ Administrators only. True, if the bot is allowed to edit administrator privileges of that user
+  , chatMemberCanManageChat         :: Maybe Bool -- ^ Administrators only. 'True', if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege.
+  , chatMemberCanDeleteMessages     :: Maybe Bool -- ^ Administrators only. True, if the administrator can delete messages of other users.
+  , chatMemberCanManageVoiceChats   :: Maybe Bool -- ^ Administrators only. True, if the administrator can manage voice chats
+  , chatMemberCanRestrictMembers    :: Maybe Bool -- ^ Administrators only. True, if the administrator can restrict, ban or unban chat members
+  , chatMemberCanPromoteMembers     :: Maybe Bool -- ^ Administrators only. True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
+  , chatMemberCanChangeInfo         :: Maybe Bool -- ^ Administrators only. True, if the administrator can change the chat title, photo and other settings
+  , chatMemberCanPostMessages       :: Maybe Bool -- ^ Administrators only. True, if the administrator can post in the channel, channels only
+  , chatMemberCanEditMessages       :: Maybe Bool -- ^ Administrators only. True, if the administrator can edit messages of other users and can pin messages, channels only
+
+  -- administrator, restricted
+  , chatMemberCanInviteUsers        :: Maybe Bool -- ^ Administrators and restricted only. True, if the administrator can invite new users to the chat
+  , chatMemberCanPinMessages        :: Maybe Bool -- ^ Administrators and restricted only. True, if the administrator can pin messages, supergroups only
+
+  -- restricted
+  , chatMemberIsMember              :: Maybe Bool -- ^ Restricted only. True, if the user is a member of the chat at the moment of the request.
+  , chatMemberCanSendMessages       :: Maybe Bool -- ^ Restricted only. True, if the user can send text messages, contacts, locations and venues
+  , chatMemberCanSendMediaMessages  :: Maybe Bool -- ^ Restricted only. True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
+  , chatMemberCanSendPolls          :: Maybe Bool -- ^ Restricted only. True, if the user is allowed to send polls.
+  , chatMemberCanSendOtherMessages  :: Maybe Bool -- ^ Restricted only. True, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages
+  , chatMemberCanAddWebPagePreviews :: Maybe Bool -- ^ Restricted only. True, if user may add web page previews to his messages, implies can_send_media_messages
+  }
+  deriving (Generic, Show)
+
+-- ** 'ChatMemberUpdated'
+
+-- | This object represents changes in the status of a chat member.
+data ChatMemberUpdated = ChatMemberUpdated
+  { chatMemberUpdatedChat          :: Chat                 -- ^ Chat the user belongs to.
+  , chatMemberUpdatedFrom          :: User                 -- ^ Performer of the action, which resulted in the change.
+  , chatMemberUpdatedDate          :: POSIXTime            -- ^ Date the change was done in Unix time.
+  , chatMemberUpdatedOldChatMember :: ChatMember           -- ^ Previous information about the chat member.
+  , chatMemberUpdatedNewChatMember :: ChatMember           -- ^ New information about the chat member.
+  , chatMemberUpdatedInviteLink    :: Maybe ChatInviteLink -- ^ Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
+  }
+  deriving (Generic, Show)
+
+-- ** 'ChatJoinRequest'
+
+-- | Represents a join request sent to a chat.
+data ChatJoinRequest = ChatJoinRequest
+  { chatJoinRequestChat       :: Chat                 -- ^ Chat to which the request was sent.
+  , chatJoinRequestFrom       :: User                 -- ^ User that sent the join request.
+  , chatJoinRequestDate       :: POSIXTime            -- ^ Date the request was sent in Unix time.
+  , chatJoinRequestBio        :: Maybe Text           -- ^ Bio of the user.
+  , chatJoinRequestInviteLink :: Maybe ChatInviteLink -- ^ Chat invite link that was used by the user to send the join request.
+  }
+  deriving (Generic, Show)
+
+-- ** 'ChatPermissions'
+
+-- | Describes actions that a non-administrator user is allowed to take in a chat.
+data ChatPermissions = ChatPermissions
+  { chatPermissionsCanSendMessages :: Maybe Bool       -- ^ True, if the user is allowed to send text messages, contacts, locations and venues.
+  , chatPermissionsCanSendMediaMessages :: Maybe Bool  -- ^ True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages.
+  , chatPermissionsCanSendPolls :: Maybe Bool          -- ^ True, if the user is allowed to send polls, implies can_send_messages.
+  , chatPermissionsCanSendOtherMessages :: Maybe Bool  -- ^ True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages.
+  , chatPermissionsCanAddWebPagePreviews :: Maybe Bool -- ^ True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages.
+  , chatPermissionsCanChangeInfo :: Maybe Bool         -- ^ True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
+  , chatPermissionsCanInviteUsers :: Maybe Bool        -- ^ True, if the user is allowed to invite new users to the chat.
+  , chatPermissionsCanPinMessages :: Maybe Bool        -- ^ True, if the user is allowed to pin messages. Ignored in public supergroups.
+  }
+  deriving (Generic, Show)
+
+-- ** 'ChatLocation'
+
+-- | Represents a location to which a chat is connected.
+data ChatLocation = ChatLocation
+  { chatLocationLocation :: Location -- ^ The location to which the supergroup is connected. Can't be a live location..
+  , chatLocationAddress :: Text      -- ^ Location address; 1-64 characters, as defined by the chat owner.
+  }
+  deriving (Generic, Show)
+
+-- ** 'ResponseParameters'
+
+-- | Contains information about why a request was unsuccessful.
+data ResponseParameters = ResponseParameters
+  { responseParametersMigrateToChatId :: Maybe ChatId -- ^ The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
+  , responseParametersRetryAfter      :: Maybe Seconds -- ^ In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
+  }
+  deriving (Show, Generic)
+
+-- * Stickers
+
+-- | The following methods and objects allow your bot to handle stickers and sticker sets.
+
+-- ** 'Sticker'
+
+-- | This object represents a sticker.
+data Sticker = Sticker
+  { stickerFileId       :: FileId             -- ^ Identifier for this file, which can be used to download or reuse the file.
+  , stickerFileUniqueId :: FileId             -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  , stickerWidth        :: Int32              -- ^ Sticker width.
+  , stickerHeight       :: Int32              -- ^ Sticker height.
+  , stickerIsAnimated   :: Bool               -- ^ True, if the sticker is animated.
+  , stickerThumb        :: Maybe PhotoSize    -- ^ Sticker thumbnail in the .WEBP or .JPG format.
+  , stickerEmoji        :: Maybe Text         -- ^ Emoji associated with the sticker.
+  , stickerSetName      :: Maybe Text         -- ^ Name of the sticker set to which the sticker belongs.
+  , stickerMaskPosition :: Maybe MaskPosition -- ^ For mask stickers, the position where the mask should be placed.
+  , stickerFileSize     :: Maybe Integer      -- ^ File size in bytes.
+  }
+  deriving (Generic, Show)
+
+-- ** 'StickerSet'
+
+-- | This object represents a sticker set.
+data StickerSet = StickerSet
+  { stickerSetName          :: Text            -- ^ Sticker set name.
+  , stickerSetTitle         :: Text            -- ^ Sticker set title.
+  , stickerSetIsAnimated    :: Bool            -- ^ True, if the sticker set contains animated stickers.
+  , stickerSetContainsMasks :: Bool            -- ^ True, if the sticker set contains masks.
+  , stickerSetStickers      :: [Sticker]       -- ^ List of all set stickers.
+  , stickerSetThumb         :: Maybe PhotoSize -- ^ Sticker set thumbnail in the .WEBP or .TGS format.
+  }
+  deriving (Generic, Show)
+
+-- ** 'MaskPosition'
+
+-- | This object describes the position on faces where a mask should be placed by default.
+data MaskPosition = MaskPosition
+  { maskPositionPoint  :: Text  -- ^ The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
+  , maskPositionXShift :: Float -- ^ Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.
+  , maskPositionYShift :: Float -- ^ Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.
+  , maskPositionScale  :: Float -- ^ Mask scaling coefficient. For example, 2.0 means double size.
+  }
+  deriving (Generic, Show)
+
+-- * Payments
+
+-- ** 'LabeledPrice'
+
+-- | This object represents a portion of the price for goods or services.
+data LabeledPrice = LabelPrice
+  { labeledPriceLabel  :: Text  -- ^ Portion label.
+  , labeledPriceAmount :: Int32 -- ^ Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
+  }
+  deriving (Generic, Show)
+
+-- ** 'Invoice'
+
+-- | This object contains basic information about an invoice.
+data Invoice = Invoice
+  { invoiceTitle          :: Text  -- ^ Product name.
+  , invoiceDescription    :: Text  -- ^ Product description.
+  , invoiceStartParameter :: Text  -- ^ Unique bot deep-linking parameter that can be used to generate this invoice.
+  , invoiceCurrency       :: Text  -- ^ Three-letter ISO 4217 currency code.
+  , invoiceTotalAmount    :: Int32 -- ^ Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
+  }
+  deriving (Generic, Show)
+
+-- ** 'ShippingAddress'
+
+-- | This object represents a shipping address.
+data ShippingAddress = ShippingAddress
+  { shippingAddressCountryCode :: Text -- ^ ISO 3166-1 alpha-2 country code.
+  , shippingAddressState       :: Text -- ^ State, if applicable.
+  , shippingAddressCity        :: Text -- ^ City.
+  , shippingAddressStreetLine1 :: Text -- ^ First line for the address.
+  , shippingAddressStreetLine2 :: Text -- ^ Second line for the address.
+  , shippingAddressPostCode    :: Text -- ^ Address post code.
+  }
+  deriving (Generic, Show)
+
+-- ** 'OrderInfo'
+
+-- | This object represents information about an order.
+data OrderInfo = OrderInfo
+  { orderInfoName            :: Maybe Text            -- ^ User name.
+  , orderInfoPhoneNumber     :: Maybe Text            -- ^ User's phone number.
+  , orderInfoEmail           :: Maybe Text            -- ^ User email.
+  , orderInfoShippingAddress :: Maybe ShippingAddress -- ^ User shipping address.
+  }
+  deriving (Generic, Show)
+
+-- ** 'ShippingOption'
+
+-- | This object represents one shipping option.
+data ShippingOption = ShippingOption
+  { shippingOptionId    :: ShippingOptionId -- ^ Shipping option identifier.
+  , shippingOptionTitle :: Text             -- ^ Option title.
+  , shippingOptionPrice :: [LabeledPrice]   -- ^ List of price portions.
+  }
+  deriving (Generic, Show)
+
+newtype ShippingOptionId = ShippingOptionId Text
+  deriving (Eq, Show, Generic, ToJSON, FromJSON)
+
+-- ** 'SuccessfulPayment'
+
+-- | This object contains basic information about a successful payment.
+data SuccessfulPayment = SuccessfulPayment
+  { successfulPaymentCurrency                :: Text                   -- ^ Three-letter ISO 4217 currency code.
+  , successfulPaymentTotalAmount             :: Int32                  -- ^ Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
+  , successfulPaymentInvoicePayload          :: Text                   -- ^ Bot specified invoice payload.
+  , successfulPaymentShippingOptionId        :: Maybe ShippingOptionId -- ^ Identifier of the shipping option chosen by the user.
+  , successfulPaymentOrderInfo               :: Maybe OrderInfo        -- ^ Order info provided by the user.
+  , successfulPaymentTelegramPaymentChargeId :: Text                   -- ^ Telegram payment identifier.
+  , successfulPaymentProviderPaymentChargeId :: Text                   -- ^ Provider payment identifier.
+  }
+  deriving (Generic, Show)
+
+-- ** 'ShippingQuery'
+
+-- | This object contains information about an incoming shipping query.
+data ShippingQuery = ShippingQuery
+  { shippingQueryId              :: Text            -- ^ Unique query identifier.
+  , shippingQueryFrom            :: User            -- ^ User who sent the query.
+  , shippingQueryInvoicePayload  :: Text            -- ^ Bot specified invoice payload.
+  , shippingQueryShippingAddress :: ShippingAddress -- ^ User specified shipping address.
+  }
+  deriving (Generic, Show)
+
+-- ** 'PreCheckoutQuery'
+
+-- | This object contains information about an incoming pre-checkout query.
+data PreCheckoutQuery = PreCheckoutQuery
+  { preCheckoutQueryId               :: Text                   -- ^ Unique query identifier.
+  , preCheckoutQueryFrom             :: User                   -- ^ User who sent the query.
+  , preCheckoutQueryCurrency         :: Text                   -- ^ Three-letter ISO 4217 currency code
+  , preCheckoutQueryTotalAmount      :: Int32                  -- ^ Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
+  , preCheckoutQueryInvoicePayload   :: Text                   -- ^ Bot specified invoice payload
+  , preCheckoutQueryShippingOptionId :: Maybe ShippingOptionId -- ^ Identifier of the shipping option chosen by the user.
+  , preCheckoutQueryOrderInfo        :: Maybe OrderInfo        -- ^ Order info provided by the user.
+  }
+  deriving (Generic, Show)
+
+-- * Telegram Passport
+
+-- | Telegram Passport is a unified authorization method for services that require personal identification. Users can upload their documents once, then instantly share their data with services that require real-world ID (finance, ICOs, etc.). Please see the manual for details.
+
+-- ** 'PassportData'
+
+-- | Contains information about Telegram Passport data shared with the bot by the user.
+data PassportData = PassportData
+  { passportDataData        :: [EncryptedPassportElement] -- ^ Array with information about documents and other Telegram Passport elements that was shared with the bot.
+  , passportDataCredentials :: EncryptedCredentials       -- ^ Encrypted credentials required to decrypt the data.
+  }
+  deriving (Generic, Show)
+
+-- ** 'PassportFile'
+
+-- | This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
+data PassportFile = PassportFile
+  { passportFileFileId       :: FileId    -- ^ Identifier for this file, which can be used to download or reuse the file.
+  , passportFileFileUniqueId :: FileId    -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+  , passportFileFileSize     :: Int32     -- ^ File size in bytes.
+  , passportFileFileDate     :: POSIXTime -- ^ Unix time when the file was uploaded.
+  }
+  deriving (Generic, Show)
+
+-- ** 'EncryptedPassportElement'
+
+-- | Contains information about documents or other Telegram Passport elements shared with the bot by the user.
+data EncryptedPassportElement = EncryptedPassportElement
+  { encryptedPassportElementType        :: PassportElementType  -- ^ One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
+  , encryptedPassportElementData        :: Maybe Text           -- ^ Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying 'EncryptedCredentials'.
+  , encryptedPassportElementPhoneNumber :: Maybe Text           -- ^ User's verified phone number, available only for “phone_number” type.
+  , encryptedPassportElementEmail       :: Maybe Text           -- ^ User's verified email address, available only for “email” type.
+  , encryptedPassportElementFiles       :: Maybe [PassportFile] -- ^ Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
+  , encryptedPassportElementFrontSide   :: Maybe PassportFile   -- ^ Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
+  , encryptedPassportElementReverseSide :: Maybe PassportFile   -- ^ Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
+  , encryptedPassportElementSelfie      :: Maybe PassportFile   -- ^ Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
+  , encryptedPassportElementTranslation :: Maybe [PassportFile] -- ^ Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
+  , encryptedPassportElementHash        :: Text                 -- ^ Base64-encoded element hash for using in 'PassportElementErrorUnspecified'.
+  } deriving (Generic, Show)
+
+
+-- | One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
+data PassportElementType
+  = PassportElementTypePersonalDetails
+  | PassportElementTypePassport
+  | PassportElementTypeDriverLicense
+  | PassportElementTypeIdentityCard
+  | PassportElementTypeInternalPassport
+  | PassportElementTypeAddress
+  | PassportElementTypeUtilityBill
+  | PassportElementTypeBankStatement
+  | PassportElementTypeRentalAgreement
+  | PassportElementTypePassportRegistration
+  | PassportElementTypeTemporaryRegistration
+  | PassportElementTypePhoneNumber
+  | PassportElementTypeEmail
+  deriving (Generic, Show)
+
+-- ** 'EncryptedCredentials'
+
+-- | Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
+data EncryptedCredentials = EncryptedCredentials
+  { encryptedCredentialsData   :: Text -- ^ Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication.
+  , encryptedCredentialsHash   :: Text -- ^ Base64-encoded data hash for data authentication.
+  , encryptedCredentialsSecret :: Text -- ^ Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption
+  }
+  deriving (Generic, Show)
+
+-- ** 'PassportElementError'
+
+data PassportErrorSource
+  = PassportErrorSourceData
+  | PassportErrorSourceFrontSide
+  | PassportErrorSourceReverseSide
+  | PassportErrorSourceSelfie
+  | PassportErrorSourceFile
+  | PassportErrorSourceFiles
+  | PassportErrorSourceTranslationFile
+  | PassportErrorSourceTranslationFiles
+  | PassportErrorSourceUnspecified
+  deriving (Generic, Show)
+
+data PassportElementError
+  = PassportElementError
+    { passportElementErroSource       :: PassportErrorSource -- ^ Error source, must be one of 'PassportErrorSource'.
+    , passportElementErrorType        :: PassportElementType -- ^ The section of the user's Telegram Passport which has the error, one of 'PassportElementType'.
+    , passportElementErrorName        :: Text                -- ^ Name of the data field which has the error.
+    , passportElementErrorHash        :: Maybe Text          -- ^ Base64-encoded data hash.
+    , passportElementErrorMessage     :: Text                -- ^ Error message.
+    , passportElementErrorFileHash    :: Maybe Text          -- ^ Base64-encoded hash of the file with the reverse side of the document.
+    , passportElementErrorFileHashes  :: Maybe [Text]        -- ^ List of base64-encoded file hashes.
+    , passportElementErrorElementHash :: Maybe Text          -- ^ Base64-encoded element hash.
+    }
+    deriving (Generic, Show)
+
+instance ToHttpApiData PassportElementError where
+  toUrlPiece = TL.toStrict . encodeToLazyText
+
+instance ToHttpApiData [PassportElementError] where
+  toUrlPiece = TL.toStrict . encodeToLazyText
+
+-- * Games
+
+-- | Your bot can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Create games via @BotFather using the /newgame command. Please note that this kind of power requires responsibility: you will need to accept the terms for each game that your bots will be offering.
+-- 
+-- Games are a new type of content on Telegram, represented by the Game and InlineQueryResultGame objects.
+-- Once you've created a game via BotFather, you can send games to chats as regular messages using the sendGame method, or use inline mode with InlineQueryResultGame.
+-- If you send the game message without any buttons, it will automatically have a 'Play GameName' button. When this button is pressed, your bot gets a CallbackQuery with the game_short_name of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.
+-- You can manually add multiple buttons to your game message. Please note that the first button in the first row must always launch the game, using the field callback_game in InlineKeyboardButton. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.
+-- To make your game more attractive, you can upload a GIF animation that demostrates the game to the users via BotFather (see Lumberjack for example).
+-- A game message will also display high scores for the current chat. Use setGameScore to post high scores to the chat with the game, add the edit_message parameter to automatically update the message with the current scoreboard.
+-- Use getGameHighScores to get data for in-game high score tables.
+-- You can also add an extra sharing button for users to share their best score to different chats.
+-- For examples of what can be done using this new stuff, check the @gamebot and @gamee bots.
+
+-- ** 'Game'
+
+-- | This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
+data Game = Game
+  { gameTitle        :: Text                  -- ^ Title of the game.
+  , gameDescription  :: Text                  -- ^ Description of the game.
+  , gamePhoto        :: [PhotoSize]           -- ^ Photo that will be displayed in the game message in chats.
+  , gameText         :: Maybe Text            -- ^ Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
+  , gameTextEntities :: Maybe [MessageEntity] -- ^ Special entities that appear in text, such as usernames, URLs, bot commands, etc.
+  , gameAnimation    :: Maybe Animation       -- ^ Animation that will be displayed in the game message in chats. Upload via @BotFather@.
+  }
+  deriving (Generic, Show)
+
+-- ** 'CallbackGame'
+
+-- | A placeholder, currently holds no information. Use BotFather to set up your game.
+newtype CallbackGame = CallbackGame Object
+  deriving (Generic, Show)
+
+-- ** 'GameHighScore'
+
+-- | This object represents one row of the high scores table for a game.
+data GameHighScore = GameHighScore
+  { gameHighScorePosition :: Int32 -- ^ Position in high score table for the game.
+  , gameHighScoreUser     :: User  -- ^ User.
+  , gameHighScoreScore    :: Int32 -- ^ Score.
+  }
+  deriving (Generic, Show)
+
+-- | Unique identifier for the target chat
+-- or username of the target channel (in the format @\@channelusername@).
+data SomeChatId
+  = SomeChatId ChatId       -- ^ Unique chat ID.
+  | SomeChatUsername Text   -- ^ Username of the target channel.
+  deriving (Generic)
+
+instance ToJSON   SomeChatId where toJSON = genericSomeToJSON
+instance FromJSON SomeChatId where parseJSON = genericSomeParseJSON
+
+instance ToHttpApiData SomeChatId where
+  toUrlPiece (SomeChatId chatid) = toUrlPiece chatid
+  toUrlPiece (SomeChatUsername name) = name
+  
+-- | This object represents a bot command.
+data BotCommand = BotCommand
+  { botCommandCommand :: Text -- ^ Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
+  , botCommandDescription :: Text -- ^ Description of the command; 1-256 characters.
+  }
+  deriving (Generic, Show)
+
+data BotCommandScope
+  = BotCommandScopeDefault -- ^ Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.
+  | BotCommandScopeAllPrivateChats -- ^ Represents the scope of bot commands, covering all private chats.
+  | BotCommandScopeAllGroupChats -- ^ Represents the scope of bot commands, covering all group and supergroup chats.
+  | BotCommandScopeAllChatAdministrators -- ^ Represents the scope of bot commands, covering all group and supergroup chat administrators.
+  | BotCommandScopeChat SomeChatId -- ^ Represents the scope of bot commands, covering a specific chat.
+  | BotCommandScopeChatAdministrators SomeChatId -- ^ Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
+  | BotCommandScopeChatMember SomeChatId UserId -- ^ Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
+
+addType :: Text -> [Pair] -> [Pair]
+addType name xs = ("type" .= name) : xs
+instance ToJSON BotCommandScope where
+  toJSON = \case
+    BotCommandScopeDefault ->
+      object $ addType "default" []
+    BotCommandScopeAllPrivateChats ->
+      object $ addType "all_private_chats" []
+    BotCommandScopeAllGroupChats ->
+      object $ addType "all_group_chats" []
+    BotCommandScopeAllChatAdministrators ->
+      object $ addType "all_chat_administrators" []
+    BotCommandScopeChat sci ->
+      object $ addType "chat" ["chat_id" .= sci]
+    BotCommandScopeChatAdministrators sci ->
+      object $ addType "chat_administrators" ["chat_id" .= sci]
+    BotCommandScopeChatMember sci ui ->
+      object $ addType "chat_member" ["chat_id" .= sci, "user_id" .= ui]
+
+instance FromJSON BotCommandScope where
+  parseJSON = withObject "BotCommandScope" \o ->
+    (o .: "type" :: Parser Text) >>= \case
+    "default" ->                pure BotCommandScopeDefault
+    "all_private_chats" ->      pure BotCommandScopeAllPrivateChats
+    "all_group_chats" ->        pure BotCommandScopeAllGroupChats
+    "all_chat_administrators"-> pure BotCommandScopeAllChatAdministrators
+    "chat" ->                        BotCommandScopeChat <$> o .: "chat_id"
+    "chat_administrators"->          BotCommandScopeChatAdministrators <$> o .: "chat_id"
+    "chat_member"->                  BotCommandScopeChatMember <$> o .: "chat_id" <*> o .: "user_id"
+    t -> fail $ Text.unpack ("Unknown type: " <> t)
+
+
+-- | Generic fields for all InputMedia structures
+data InputMediaGeneric = InputMediaGeneric
+  { inputMediaGenericMedia :: InputFile -- ^ File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name.
+  , inputMediaGenericCaption :: Maybe Text -- ^ Caption of the photo to be sent, 0-1024 characters after entities parsing.
+  , inputMediaGenericParseMode :: Maybe Text -- ^ Mode for parsing entities in the photo caption. See formatting options <https:\/\/core.telegram.org\/bots\/api#formatting-options> for more details.
+  , inputMediaGenericCaptionEntities :: Maybe [MessageEntity] -- ^ List of special entities that appear in the caption, which can be specified instead of parse_mode.
+  }
+  deriving Generic
+
+instance ToJSON InputMediaGeneric where toJSON = gtoJSON
+
+instance ToMultipart Tmp InputMediaGeneric where
+  toMultipart InputMediaGeneric{..} = makeFile "media" inputMediaGenericMedia (MultipartData fields []) where
+    fields = catMaybes
+      [ inputMediaGenericCaption <&>
+        \t -> Input "caption" t
+      , inputMediaGenericParseMode <&>
+        \t -> Input "parse_mode" t
+      , inputMediaGenericCaptionEntities <&>
+        \t -> Input "caption_entities" (TL.toStrict $ encodeToLazyText t)
+      ]
+
+data InputMediaGenericThumb = InputMediaGenericThumb
+  { inputMediaGenericGeneric :: InputMediaGeneric
+  , inputMediaGenericThumb :: Maybe InputFile -- ^ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. 
+  }
+
+instance ToJSON InputMediaGenericThumb where
+  toJSON InputMediaGenericThumb{..}
+    = addJsonFields (toJSON inputMediaGenericGeneric)
+      ["thumb" .= inputMediaGenericThumb]
+
+instance ToMultipart Tmp InputMediaGenericThumb where
+  toMultipart = \case
+    InputMediaGenericThumb generic Nothing -> toMultipart generic
+    InputMediaGenericThumb generic (Just thumb) -> makeFile "thumb" thumb (toMultipart generic) where
+
+
+data InputMedia
+  = InputMediaPhoto InputMediaGeneric -- ^ Represents a photo to be sent.
+  | InputMediaVideo -- ^ Represents a video to be sent.
+    { inputMediaVideoGeneric :: InputMediaGenericThumb
+    , inputMediaVideoWidth :: Maybe Integer -- ^ Video width
+    , inputMediaVideoHeight :: Maybe Integer -- ^ Video height
+    , inputMediaVideoDuration :: Maybe Integer -- ^ Video duration in seconds
+    , inputMediaVideoSupportsStreaming :: Maybe Bool -- ^ Pass True, if the uploaded video is suitable for streaming
+    }
+  | InputMediaAnimation -- ^ Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
+    { inputMediaAnimationGeneric :: InputMediaGenericThumb
+    , inputMediaAnimationWidth :: Maybe Integer -- ^ Animation width
+    , inputMediaAnimationHeight :: Maybe Integer -- ^ Animation height
+    , inputMediaAnimationDuration :: Maybe Integer -- ^ Animation duration in seconds
+    }
+  | InputMediaAudio -- ^ Represents an audio file to be treated as music to be sent.
+    { inputMediaAudioGeneric :: InputMediaGenericThumb
+    , inputMediaAudioDuration :: Maybe Integer -- ^ Duration of the audio in seconds
+    , inputMediaAudioPerformer :: Maybe Text -- ^ Performer of the audio
+    , inputMediaAudioTitle :: Maybe Text -- ^ Title of the audio
+    }
+  | InputMediaDocument -- ^ Represents a general file to be sent.
+    { inputMediaDocumentGeneric :: InputMediaGenericThumb
+    , inputMediaDocumentDisableContentTypeDetection :: Maybe Bool -- ^ Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album.
+    }
+
+instance ToJSON InputMedia where
+  toJSON = \case
+    InputMediaPhoto img ->
+      addJsonFields (toJSON img) (addType "photo" [])
+    InputMediaVideo imgt width height duration streaming ->
+      addJsonFields (toJSON imgt)
+                (addType "video"
+                [ "width" .= width
+                , "height" .= height
+                , "duration" .= duration
+                , "support_streaming" .= streaming
+                ])
+    InputMediaAnimation imgt width height duration ->
+      addJsonFields (toJSON imgt)
+                (addType "animation"
+                [ "width" .= width
+                , "height" .= height
+                , "duration" .= duration
+                ])
+    InputMediaAudio imgt duration performer title ->
+      addJsonFields (toJSON imgt)
+                (addType "audio"
+                [ "duration" .= duration
+                , "performer" .= performer
+                , "title" .= title
+                ])
+    InputMediaDocument imgt dctd ->
+      addJsonFields (toJSON imgt)
+                (addType "document" ["disable_content_type_detection" .= dctd])
+
+
+
+instance ToMultipart Tmp InputMedia where
+  toMultipart = let
+    in \case
+    InputMediaPhoto img ->
+      addMultipartFields
+      [ Input "type" "photo"
+      ] (toMultipart img)
+    InputMediaVideo imgt width height duration streaming ->
+      addMultipartFields
+      (Input "type" "video"
+      : catMaybes 
+      [ width <&>
+        \t -> Input "width" (TL.toStrict $ encodeToLazyText t)
+      , height <&>
+        \t -> Input "height" (TL.toStrict $ encodeToLazyText t)
+      , duration <&>
+        \t -> Input "duration" (TL.toStrict $ encodeToLazyText t)
+      , streaming <&>
+        \t -> Input "support_streaming" (bool "false" "true" t)
+      ]) (toMultipart imgt)
+    InputMediaAnimation imgt width height duration ->
+      addMultipartFields
+      (Input "type" "animation"
+      : catMaybes 
+      [ width <&>
+        \t -> Input "width" (TL.toStrict $ encodeToLazyText t)
+      , height <&>
+        \t -> Input "height" (TL.toStrict $ encodeToLazyText t)
+      , duration <&>
+        \t -> Input "duration" (TL.toStrict $ encodeToLazyText t)
+      ]) (toMultipart imgt)
+    InputMediaAudio imgt duration performer title ->
+      addMultipartFields
+      (Input "type" "audio"
+      : catMaybes 
+      [ duration <&>
+        \t -> Input "duration" (TL.toStrict $ encodeToLazyText t)
+      , performer <&>
+        \t -> Input "performer" t
+      , title <&>
+        \t -> Input "title" t
+      ]) (toMultipart imgt)
+    InputMediaDocument imgt dctd ->
+      addMultipartFields
+      (Input "type" "document"
+      : catMaybes 
+      [ dctd <&> 
+         \t -> Input "disable_content_type_detection" (bool "false" "true" t)
+      ]) (toMultipart imgt)
+
+foldMap deriveJSON'
+  [ ''User
+  , ''Chat
+  , ''Message
+  , ''MessageEntity
+  , ''PhotoSize
+  , ''Audio
+  , ''Document
+  , ''Sticker
+  , ''Video
+  , ''Voice
+  , ''VideoNote
+  , ''Contact
+  , ''Location
+  , ''Venue
+  , ''UserProfilePhotos
+  , ''File
+  , ''ReplyKeyboardMarkup
+  , ''KeyboardButton
+  , ''ReplyKeyboardRemove
+  , ''InlineKeyboardMarkup
+  , ''InlineKeyboardButton
+  , ''CallbackQuery
+  , ''ForceReply
+  , ''ChatPhoto
+  , ''ChatMember
+  , ''ResponseParameters
+  , ''MaskPosition
+  , ''CallbackGame
+  , ''Animation
+  , ''Dice
+  , ''Game
+  , ''Poll
+  , ''PollOption
+  , ''MessageAutoDeleteTimerChanged
+  , ''Invoice
+  , ''SuccessfulPayment
+  , ''OrderInfo
+  , ''ShippingAddress
+  , ''PassportData
+  , ''EncryptedPassportElement
+  , ''PassportElementType
+  , ''PassportFile
+  , ''PassportErrorSource
+  , ''PassportElementError
+  , ''EncryptedCredentials
+  , ''ProximityAlertTriggered
+  , ''VoiceChatScheduled
+  , ''VoiceChatStarted
+  , ''VoiceChatEnded
+  , ''VoiceChatParticipantsInvited
+  , ''ChatPermissions
+  , ''ChatLocation
+  , ''StickerSet
+  , ''BotCommand
+  , ''ChatInviteLink
+  , ''LabeledPrice
+  , ''ShippingOption
+  , ''ShippingQuery
+  , ''PreCheckoutQuery
   ]
diff --git a/src/Telegram/Bot/API/UpdatingMessages.hs b/src/Telegram/Bot/API/UpdatingMessages.hs
--- a/src/Telegram/Bot/API/UpdatingMessages.hs
+++ b/src/Telegram/Bot/API/UpdatingMessages.hs
@@ -2,6 +2,7 @@
 {-# LANGUAGE DeriveGeneric    #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeOperators    #-}
+{-# LANGUAGE TemplateHaskell #-}
 module Telegram.Bot.API.UpdatingMessages where
 
 import           Data.Aeson
@@ -11,7 +12,7 @@
 import           Servant.API
 import           Servant.Client                  (ClientM, client)
 
-import           Telegram.Bot.API.Internal.Utils (gparseJSON, gtoJSON)
+import           Telegram.Bot.API.Internal.Utils (deriveJSON', gtoJSON)
 import           Telegram.Bot.API.MakingRequests
 import           Telegram.Bot.API.Methods
 import           Telegram.Bot.API.Types
@@ -21,23 +22,114 @@
 type EditMessageText
   = "editMessageText"
   :> ReqBody '[JSON] EditMessageTextRequest
-  :> Post '[JSON] (Response Message)
+  :> Post '[JSON] (Response (Either Bool Message))
 
--- | Use this method to send text messages.
--- On success, the sent 'Message' is returned.
-editMessageText :: EditMessageTextRequest -> ClientM (Response Message)
+-- | Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited 'Message' is returned, otherwise 'True' is returned.
+editMessageText :: EditMessageTextRequest -> ClientM (Response (Either Bool Message))
 editMessageText = client (Proxy @EditMessageText)
 
--- | Request parameters for 'sendMessage'.
+-- | Request parameters for 'editMessageText'.
 data EditMessageTextRequest = EditMessageTextRequest
   { editMessageTextChatId                :: Maybe SomeChatId -- ^ Required if 'editMessageTextInlineMessageId' is not specified. Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).
   , editMessageTextMessageId             :: Maybe MessageId -- ^ Required if 'editMessageTextInlineMessageId' is not specified. Identifier of the sent message.
   , editMessageTextInlineMessageId       :: Maybe MessageId -- ^ Required if 'editMessageTextChatId' and 'editMessageTextMessageId' are not specified. Identifier of the sent message.
   , editMessageTextText                  :: Text -- ^ Text of the message to be sent.
   , editMessageTextParseMode             :: Maybe ParseMode -- ^ Send 'Markdown' or 'HTML', if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
+  , editMessageEntities                  :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in message text, which can be specified instead of /parse_mode/.
   , editMessageTextDisableWebPagePreview :: Maybe Bool -- ^ Disables link previews for links in this message.
   , editMessageTextReplyMarkup           :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
 } deriving (Generic)
 
-instance ToJSON   EditMessageTextRequest where toJSON = gtoJSON
-instance FromJSON EditMessageTextRequest where parseJSON = gparseJSON
+-- | Request parameters for 'editMessageCaption'.
+data EditMessageCaptionRequest = EditMessageCaptionRequest
+  { editMessageCaptionChatId           :: Maybe SomeChatId -- ^ Required if 'editMessageCaptionMessageId' is not specified. Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).
+  , editMessageCaptionMessageId        :: Maybe MessageId -- ^ Required if 'editMessageCaptionInlineMessageId' is not specified. Identifier of the sent message.
+  , editMessageCaptionInlineMessageId  :: Maybe MessageId -- ^ Required if 'editMessageCaptionChatId' and 'editMessageCaptionMessageId' are not specified. Identifier of the sent message.
+  , editMessageCaptionCaption          :: Maybe Text -- ^ New caption of the message, 0-1024 characters after entities parsing
+  , editMessageCaptionParseMode        :: Maybe ParseMode -- ^ Mode for parsing entities in the message caption. See formatting options for more details.
+  , editMessageCaptionCaptionEntities  :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
+  , editMessageCaptionReplyMarkup      :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+} deriving (Generic)
+
+type EditMessageCaption  = "editMessageCaption"
+  :> ReqBody '[JSON] EditMessageCaptionRequest
+  :> Post '[JSON] (Response (Either Bool Message))
+
+-- | Use this method to edit captions of messages.
+--   On success, if the edited message is not an
+--   inline message, the edited Message is returned,
+--   otherwise True is returned.
+editMessageCaption :: EditMessageCaptionRequest -> ClientM (Response (Either Bool Message))
+editMessageCaption = client (Proxy @EditMessageCaption)
+
+-- | Request parameters for 'editMessageMedia'.
+data EditMessageMediaRequest = EditMessageMediaRequest
+  { editMessageMediaChatId           :: Maybe SomeChatId -- ^ Required if 'editMessageMediaMessageId' is not specified. Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).
+  , editMessageMediaMessageId        :: Maybe MessageId -- ^ Required if 'editMessageMediaInlineMessageId' is not specified. Identifier of the sent message.
+  , editMessageMediaInlineMessageId  :: Maybe MessageId -- ^ Required if 'editMessageMediaChatId' and 'editMessageMediaMessageId' are not specified. Identifier of the sent message.
+  , editMessageMediaMedia            :: InputMedia -- ^ A JSON-serialized object for a new media content of the message
+  , editMessageMediaReplyMarkup      :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+} deriving (Generic)
+
+instance ToJSON EditMessageMediaRequest where toJSON = gtoJSON
+
+type EditMessageMedia  = "editMessageMedia"
+  :> ReqBody '[JSON] EditMessageMediaRequest
+  :> Post '[JSON] (Response (Either Bool Message))
+
+-- | Use this method to edit animation, audio,
+--   document, photo, or video messages. If a
+--   message is part of a message album, then it
+--   can be edited only to an audio for audio albums,
+--   only to a document for document albums and to a
+--   photo or a video otherwise. When an inline message
+--   is edited, a new file can't be uploaded; use a
+--   previously uploaded file via its file_id or specify a URL.
+--   On success, if the edited message is not an inline
+--   message, the edited Message is returned, otherwise True is returned.
+editMessageMedia :: EditMessageMediaRequest -> ClientM (Response (Either Bool Message))
+editMessageMedia = client (Proxy @EditMessageMedia)
+
+-- | Request parameters for 'editMessageReplyMarkup'.
+data EditMessageReplyMarkupRequest = EditMessageReplyMarkupRequest
+  { editMessageReplyMarkupChatId           :: Maybe SomeChatId -- ^ Required if 'editMessageReplyMarkupMessageId' is not specified. Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).
+  , editMessageReplyMarkupMessageId        :: Maybe MessageId -- ^ Required if 'editMessageReplyMarkupInlineMessageId' is not specified. Identifier of the sent message.
+  , editMessageReplyMarkupInlineMessageId  :: Maybe MessageId -- ^ Required if 'editMessageReplyMarkupChatId' and 'editMessageReplyMarkupMessageId' are not specified. Identifier of the sent message.
+  , editMessageReplyMarkupReplyMarkup      :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+} deriving (Generic)
+
+
+type EditMessageReplyMarkup = "editMessageReplyMarkup"
+  :> ReqBody '[JSON] EditMessageReplyMarkupRequest
+  :> Post '[JSON] (Response (Either Bool Message))
+
+-- | Use this method to edit only the reply markup of messages.
+--   On success, if the edited message is not an inline message,
+--   the edited Message is returned, otherwise True is returned.
+editMessageReplyMarkup :: EditMessageReplyMarkupRequest -> ClientM (Response (Either Bool Message))
+editMessageReplyMarkup = client (Proxy @EditMessageReplyMarkup)
+
+-- | Request parameters for 'stopPoll'.
+data StopPollRequest = StopPollRequest
+  { stopPollChatId           :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+  , stopPollMessageId        :: MessageId -- ^ Identifier of the original message with the poll
+  , stopPollReplyMarkup      :: Maybe SomeReplyMarkup -- ^ A JSON-serialized object for a new message inline keyboard.
+  } deriving (Generic)
+
+
+type StopPoll = "stopPoll"
+  :> ReqBody '[JSON] StopPollRequest
+  :> Post '[JSON] (Response Poll)
+
+-- | Use this method to stop a poll which was sent by the bot.
+--   On success, the stopped Poll is returned.
+stopPoll :: StopPollRequest -> ClientM (Response Poll)
+stopPoll = client (Proxy @StopPoll)
+
+
+foldMap deriveJSON' 
+  [ ''EditMessageTextRequest
+  , ''EditMessageCaptionRequest
+  , ''EditMessageReplyMarkupRequest
+  , ''StopPollRequest
+  ]
diff --git a/src/Telegram/Bot/Simple.hs b/src/Telegram/Bot/Simple.hs
--- a/src/Telegram/Bot/Simple.hs
+++ b/src/Telegram/Bot/Simple.hs
@@ -11,4 +11,4 @@
 import           Telegram.Bot.Simple.Eff
 import           Telegram.Bot.Simple.InlineKeyboard
 import           Telegram.Bot.Simple.Reply
-
+import           Telegram.Bot.Simple.Instances()
diff --git a/src/Telegram/Bot/Simple/BotApp.hs b/src/Telegram/Bot/Simple/BotApp.hs
--- a/src/Telegram/Bot/Simple/BotApp.hs
+++ b/src/Telegram/Bot/Simple/BotApp.hs
@@ -27,7 +27,7 @@
 startBotAsync bot env = do
   botEnv <- startBotEnv bot env
   fork_ $ startBotPolling bot botEnv
-  return (issueAction botEnv Nothing)
+  return (issueAction botEnv Nothing . Just)
   where
     fork_ = void . forkIO . void . flip runClientM env
 
diff --git a/src/Telegram/Bot/Simple/BotApp/Internal.hs b/src/Telegram/Bot/Simple/BotApp/Internal.hs
--- a/src/Telegram/Bot/Simple/BotApp/Internal.hs
+++ b/src/Telegram/Bot/Simple/BotApp/Internal.hs
@@ -5,7 +5,7 @@
 
 import           Control.Concurrent      (ThreadId, forkIO, threadDelay)
 import           Control.Concurrent.STM
-import           Control.Monad           (forever, void)
+import           Control.Monad           (forever, void, (<=<))
 import           Control.Monad.Except    (catchError)
 import           Control.Monad.Trans     (liftIO)
 import           Data.Bifunctor          (first)
@@ -63,7 +63,7 @@
         writeTVar botModelVar newModel
         return effects
   res <- flip runClientM botClientEnv $
-    mapM_ ((>>= liftIO . issueAction botEnv Nothing) . runBotM (BotContext botUser Nothing)) effects
+    mapM_ ((liftIO . issueAction botEnv Nothing) <=< runBotM (BotContext botUser Nothing)) effects
   case res of
     Left err -> print err
     Right _  -> return ()
@@ -87,9 +87,10 @@
   <*> (either (error . show) Telegram.responseResult <$> runClientM Telegram.getMe env)
 
 -- | Issue a new action for the bot to process.
-issueAction :: BotEnv model action -> Maybe Telegram.Update -> action -> IO ()
-issueAction BotEnv{..} update action = atomically $
+issueAction :: BotEnv model action -> Maybe Telegram.Update -> Maybe action -> IO ()
+issueAction BotEnv{..} update (Just action) = atomically $
   writeTQueue botActionsQueue (update, action)
+issueAction _ _ _ = pure ()
 
 -- | Process one action.
 processAction
@@ -105,7 +106,7 @@
       (newModel, effects) -> do
         writeTVar botModelVar newModel
         return effects
-  mapM_ ((>>= liftIO . issueAction botEnv update) . runBotM (BotContext botUser update)) effects
+  mapM_ ((liftIO . issueAction botEnv update) <=< runBotM (BotContext botUser update)) effects
 
 -- | A job to wait for the next action and process it.
 processActionJob :: BotApp model action -> BotEnv model action -> ClientM ()
@@ -127,10 +128,10 @@
       maction <- botAction update <$> readTVarIO botModelVar
       case maction of
         Nothing     -> return ()
-        Just action -> issueAction botEnv (Just update) action
+        Just action -> issueAction botEnv (Just update) (Just action)
 
 -- | Start 'Telegram.Update' polling with a given update handler.
-startPolling :: (Telegram.Update -> ClientM ()) -> ClientM ()
+startPolling :: (Telegram.Update -> ClientM a) -> ClientM a
 startPolling handleUpdate = go Nothing
   where
     go lastUpdateId = do
diff --git a/src/Telegram/Bot/Simple/Debug.hs b/src/Telegram/Bot/Simple/Debug.hs
--- a/src/Telegram/Bot/Simple/Debug.hs
+++ b/src/Telegram/Bot/Simple/Debug.hs
@@ -1,11 +1,17 @@
 {-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE CPP #-}
 module Telegram.Bot.Simple.Debug where
 
 import           Control.Monad.Trans        (liftIO)
 import           Control.Monad.Writer       (tell)
 import           Data.Aeson                 (ToJSON)
 import qualified Data.Aeson.Encode.Pretty   as Aeson
-import           Data.Monoid                ((<>))
+#if defined(MIN_VERSION_GLASGOW_HASKELL)
+#if MIN_VERSION_GLASGOW_HASKELL(8,6,2,0)
+#else
+import           Data.Monoid                     ((<>))
+#endif
+#endif
 import qualified Data.Text.Lazy             as Text
 import qualified Data.Text.Lazy.Encoding    as Text
 import           Debug.Trace                (trace)
@@ -70,9 +76,10 @@
   -> BotApp model action
 traceBotActionsWith f botApp = botApp { botHandler = newHandler }
   where
-    traceAction action = action <$ do
+    traceAction (Just action) = Just action <$ do
       liftIO $ putStrLn (f (TracedIssuedAction action))
-
+    traceAction Nothing = pure Nothing
+    
     newHandler !action model = do
       Eff (tell (map (>>= traceAction) actions))
       pure newModel
diff --git a/src/Telegram/Bot/Simple/Eff.hs b/src/Telegram/Bot/Simple/Eff.hs
--- a/src/Telegram/Bot/Simple/Eff.hs
+++ b/src/Telegram/Bot/Simple/Eff.hs
@@ -1,5 +1,9 @@
 {-# LANGUAGE DeriveFunctor              #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE RankNTypes                 #-}
+{-# LANGUAGE MultiParamTypeClasses      #-}
+{-# LANGUAGE GADTs                      #-}
+{-# LANGUAGE FlexibleInstances          #-}
 module Telegram.Bot.Simple.Eff where
 
 import           Control.Monad.Reader
@@ -26,27 +30,46 @@
 runBotM :: BotContext -> BotM a -> ClientM a
 runBotM update = flip runReaderT update . _runBotM
 
-newtype Eff action model = Eff { _runEff :: Writer [BotM action] model }
+newtype Eff action model = Eff { _runEff :: Writer [BotM (Maybe action)] model }
   deriving (Functor, Applicative, Monad)
 
+-- | The idea behind following type class is
+--   to allow you defining the type 'ret' you want to return from 'BotM' action.
+--   You can create your own return-types via new instances.
+--   Here 'action' is a 'botAction'
+--   type, that will be used further in 'botHandler' function.
+--   If you don't want to return action use 'Nothing' instead.
+--
+--   See "Telegram.Bot.Simple.Instances" for more commonly useful instances.
+--   - @GetAction a a@ - for simple making finite automata of
+--   BotM actions. (For example you can log every update
+--   and then return new 'action' to answer at message/send sticker/etc)
+--   - @GetAction () a@ - to use @pure ()@ instead of dealing with @Nothing@.
+--   - @GetAction Text a@ - to add some sugar over the 'replyText' function.
+--   'OverloadedStrings' breaks type inference,
+--   so we advise to use @replyText \"message\"@
+--   instead of @pure \@_ \@Text \"message\"@.
+class GetAction return action where
+  getNextAction :: BotM return -> BotM (Maybe action)
+
 instance Bifunctor Eff where
-  bimap f g = Eff . mapWriter (bimap g (map (fmap f))) . _runEff
+  bimap f g = Eff . mapWriter (bimap g (map . fmap . fmap $ f)) . _runEff
 
-runEff :: Eff action model -> (model, [BotM action])
+runEff :: Eff action model -> (model, [BotM (Maybe action)])
 runEff = runWriter . _runEff
 
-eff :: BotM a -> Eff a ()
-eff e = Eff (tell [e])
+eff :: GetAction a b => BotM a -> Eff b ()
+eff e = Eff (tell [getNextAction e])
 
-withEffect :: BotM action -> model -> Eff action model
+withEffect :: GetAction a action => BotM a -> model -> Eff action model
 withEffect effect model = eff effect >> pure model
 
-(<#) :: model -> BotM action -> Eff action model
+(<#) :: GetAction a action => model -> BotM a -> Eff action model
 (<#) = flip withEffect
 
 -- | Set a specific 'Telegram.Update' in a 'BotM' context.
 setBotMUpdate :: Maybe Telegram.Update -> BotM a -> BotM a
-setBotMUpdate update (BotM m) = BotM (local f m)
+setBotMUpdate update (BotM m) =  BotM (local f m)
   where
     f botContext = botContext { botContextUpdate = update }
 
diff --git a/src/Telegram/Bot/Simple/Instances.hs b/src/Telegram/Bot/Simple/Instances.hs
new file mode 100644
--- /dev/null
+++ b/src/Telegram/Bot/Simple/Instances.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE BlockArguments        #-}
+{-# LANGUAGE FlexibleInstances     #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# OPTIONS_GHC -Wno-orphans       #-}
+module Telegram.Bot.Simple.Instances where
+
+import Data.Text (Text)
+
+import Telegram.Bot.Simple.Eff
+import Telegram.Bot.Simple.Reply (replyText)
+
+instance GetAction a a where
+  getNextAction effect = Just <$> effect
+
+instance GetAction () a where
+  getNextAction effect = Nothing <$ effect
+
+instance GetAction Text a where
+  getNextAction effect = getNextAction do
+    t <- effect
+    replyText t
diff --git a/src/Telegram/Bot/Simple/Reply.hs b/src/Telegram/Bot/Simple/Reply.hs
--- a/src/Telegram/Bot/Simple/Reply.hs
+++ b/src/Telegram/Bot/Simple/Reply.hs
@@ -8,7 +8,8 @@
 import           Data.Text               (Text)
 import           GHC.Generics            (Generic)
 
-import           Telegram.Bot.API        as Telegram
+import           Telegram.Bot.API        as Telegram hiding (editMessageText, editMessageReplyMarkup)
+import qualified Telegram.Bot.API.UpdatingMessages as Update
 import           Telegram.Bot.Simple.Eff
 
 -- | Get current 'ChatId' if possible.
@@ -37,9 +38,11 @@
 data ReplyMessage = ReplyMessage
   { replyMessageText                  :: Text -- ^ Text of the message to be sent.
   , replyMessageParseMode             :: Maybe ParseMode -- ^ Send 'Markdown' or 'HTML', if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
+  , replyMessageEntities              :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in message text, which can be specified instead of /parse_mode/.
   , replyMessageDisableWebPagePreview :: Maybe Bool -- ^ Disables link previews for links in this message.
   , replyMessageDisableNotification   :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
   , replyMessageReplyToMessageId      :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
+ , replyMessageAllowSendingWithoutReply :: Maybe Bool -- ^ Pass 'True', if the message should be sent even if the specified replied-to message is not found.
   , replyMessageReplyMarkup           :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
   } deriving (Generic)
 
@@ -48,17 +51,20 @@
 
 -- | Create a 'ReplyMessage' with just some 'Text' message.
 toReplyMessage :: Text -> ReplyMessage
-toReplyMessage text = ReplyMessage text Nothing Nothing Nothing Nothing Nothing
+toReplyMessage text
+  = ReplyMessage text Nothing Nothing Nothing Nothing Nothing Nothing Nothing
 
 replyMessageToSendMessageRequest :: SomeChatId -> ReplyMessage -> SendMessageRequest
 replyMessageToSendMessageRequest someChatId ReplyMessage{..} = SendMessageRequest
   { sendMessageChatId = someChatId
   , sendMessageText = replyMessageText
   , sendMessageParseMode = replyMessageParseMode
+  , sendMessageEntities = replyMessageEntities
   , sendMessageDisableWebPagePreview = replyMessageDisableWebPagePreview
   , sendMessageDisableNotification = replyMessageDisableNotification
   , sendMessageReplyToMessageId = replyMessageReplyToMessageId
   , sendMessageReplyMarkup = replyMessageReplyMarkup
+  , sendMessageAllowSendingWithoutReply = replyMessageAllowSendingWithoutReply
   }
 
 -- | Reply in a chat with a given 'SomeChatId'.
@@ -104,6 +110,7 @@
     , editMessageTextParseMode = editMessageParseMode
     , editMessageTextDisableWebPagePreview = editMessageDisableWebPagePreview
     , editMessageTextReplyMarkup = editMessageReplyMarkup
+    , editMessageEntities = Nothing
     , ..
     }
   where
@@ -126,7 +133,7 @@
 editMessage :: EditMessageId -> EditMessage -> BotM ()
 editMessage editMessageId emsg = do
   let msg = editMessageToEditMessageTextRequest editMessageId emsg
-  void $ liftClientM $ Telegram.editMessageText msg
+  void $ liftClientM $ Update.editMessageText msg
 
 editUpdateMessage :: EditMessage -> BotM ()
 editUpdateMessage emsg = do
diff --git a/src/Telegram/Bot/Simple/UpdateParser.hs b/src/Telegram/Bot/Simple/UpdateParser.hs
--- a/src/Telegram/Bot/Simple/UpdateParser.hs
+++ b/src/Telegram/Bot/Simple/UpdateParser.hs
@@ -5,7 +5,12 @@
 
 import           Control.Applicative
 import           Control.Monad.Reader
-import           Data.Monoid          ((<>))
+#if defined(MIN_VERSION_GLASGOW_HASKELL)
+#if MIN_VERSION_GLASGOW_HASKELL(8,6,2,0)
+#else
+import           Data.Monoid                     ((<>))
+#endif
+#endif
 import           Data.Text            (Text)
 import qualified Data.Text            as Text
 import           Text.Read            (readMaybe)
@@ -68,3 +73,7 @@
 
 updateMessageText :: Update -> Maybe Text
 updateMessageText = updateMessage >=> messageText
+
+
+updateMessageSticker :: Update -> Maybe Sticker
+updateMessageSticker = updateMessage >=> messageSticker 
diff --git a/telegram-bot-simple.cabal b/telegram-bot-simple.cabal
--- a/telegram-bot-simple.cabal
+++ b/telegram-bot-simple.cabal
@@ -1,11 +1,11 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.34.4.
+-- This file has been generated from package.yaml by hpack version 0.34.6.
 --
 -- see: https://github.com/sol/hpack
 
 name:           telegram-bot-simple
-version:        0.3.8
+version:        0.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
@@ -37,6 +37,7 @@
       Telegram.Bot.API.Internal.Utils
       Telegram.Bot.API.MakingRequests
       Telegram.Bot.API.Methods
+      Telegram.Bot.API.Passport
       Telegram.Bot.API.Payments
       Telegram.Bot.API.Stickers
       Telegram.Bot.API.Types
@@ -48,6 +49,7 @@
       Telegram.Bot.Simple.Debug
       Telegram.Bot.Simple.Eff
       Telegram.Bot.Simple.InlineKeyboard
+      Telegram.Bot.Simple.Instances
       Telegram.Bot.Simple.Reply
       Telegram.Bot.Simple.UpdateParser
   other-modules:
@@ -119,8 +121,56 @@
     , unordered-containers
   default-language: Haskell2010
 
+executable example-game-bot
+  main-is: examples/GameBot.hs
+  other-modules:
+      Paths_telegram_bot_simple
+  ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
+  build-depends:
+      aeson
+    , aeson-pretty
+    , base >=4.9 && <5
+    , blaze-html
+    , bytestring
+    , cron >=0.7.0
+    , cookie
+    , dhall
+    , filepath
+    , hashable
+    , http-api-data
+    , http-client
+    , http-client-tls
+    , http-types
+    , monad-control
+    , mtl
+    , optparse-applicative
+    , pretty-show
+    , prettyprinter
+    , profunctors
+    , QuickCheck
+    , random
+    , servant
+    , servant-blaze
+    , servant-client
+    , servant-multipart
+    , servant-multipart-api
+    , servant-multipart-client
+    , servant-server
+    , split
+    , stm
+    , telegram-bot-simple
+    , template-haskell
+    , text
+    , time
+    , transformers
+    , unordered-containers
+    , unix
+    , uuid
+    , warp
+  default-language: Haskell2010
+
 executable example-todo-bot
-  main-is: examples/EchoBot.hs
+  main-is: examples/TodoBot.hs
   other-modules:
       Paths_telegram_bot_simple
   ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
