{-# LANGUAGE DataKinds #-}{-# LANGUAGE DeriveGeneric #-}{-# LANGUAGE TypeApplications #-}{-# LANGUAGE TypeOperators #-}module Telegram.Bot.API.Methods.GetMyCommands whereimport Data.Aeson (FromJSON (..), ToJSON (..))import Data.Proxyimport Data.Textimport 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-- ** 'getMyCommands'-- | 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 Genericinstance ToJSON GetMyCommandsRequest where toJSON = gtoJSONinstance FromJSON GetMyCommandsRequest where parseJSON = gparseJSONtype 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)makeDefault ''GetMyCommandsRequest