packages feed

telegram-bot-api-7.3 / src / Telegram / Bot / API / Methods / SetChatMenuButton.hs

{-# LANGUAGE DataKinds #-}{-# LANGUAGE DeriveGeneric #-}{-# LANGUAGE TypeApplications #-}{-# LANGUAGE TypeOperators #-}module Telegram.Bot.API.Methods.SetChatMenuButton whereimport Data.Aeson (FromJSON (..), ToJSON (..))import Data.Proxyimport GHC.Generics (Generic)import Servant.APIimport Servant.Client hiding (Response)import Telegram.Bot.API.Internal.Utilsimport Telegram.Bot.API.MakingRequestsimport Telegram.Bot.API.Typesimport Telegram.Bot.API.Internal.TH-- ** 'setChatMenuButton'-- | Request parameters for 'setChatMenuButton'.data SetChatMenuButtonRequest = SetChatMenuButtonRequest  { setChatMenuButtonRequestChatId     :: Maybe ChatId     -- ^ Unique identifier for the target private chat. If not specified, default bot's menu button will be changed.  , setChatMenuButtonRequestMenuButton :: Maybe MenuButton -- ^ A JSON-serialized object for the new bot's menu button. Defaults to @MenuButtonDefault@.  }  deriving Genericinstance ToJSON   SetChatMenuButtonRequest where toJSON = gtoJSONinstance FromJSON SetChatMenuButtonRequest where parseJSON = gparseJSONtype SetChatMenuButton = "setChatMenuButton"  :> ReqBody '[JSON] SetChatMenuButtonRequest  :> Post '[JSON] (Response Bool)-- | Use this method to change the bot's menu button in a private chat,--  or the default menu button. Returns True on success.setChatMenuButton :: SetChatMenuButtonRequest -> ClientM (Response Bool)setChatMenuButton = client (Proxy @SetChatMenuButton)makeDefault ''SetChatMenuButtonRequest