packages feed

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

{-# LANGUAGE DataKinds #-}{-# LANGUAGE DeriveGeneric #-}{-# LANGUAGE TypeApplications #-}{-# LANGUAGE TypeOperators #-}module Telegram.Bot.API.Methods.SetMyName whereimport Data.Aeson (FromJSON (..), ToJSON (..))import Data.Proxyimport GHC.Generics (Generic)import Data.Text (Text)import Servant.APIimport Servant.Client hiding (Response)import Telegram.Bot.API.Internal.Utilsimport Telegram.Bot.API.MakingRequestsimport Telegram.Bot.API.Internal.TH-- ** 'setMyName'data SetMyNameRequest = SetMyNameRequest  { setMyNameName  :: Maybe Text -- ^ New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.  , setMyNameLanguageCode :: Maybe Text -- ^ A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.  }  deriving Genericinstance ToJSON   SetMyNameRequest where toJSON = gtoJSONinstance FromJSON SetMyNameRequest where parseJSON = gparseJSONtype SetMyName = "setMyName"  :> ReqBody '[JSON] SetMyNameRequest  :> Post '[JSON] (Response Bool)-- | Use this method to change the bot's name.--   Returns 'True' on success.setMyName :: SetMyNameRequest -> ClientM (Response Bool)setMyName = client (Proxy @SetMyName)makeDefault ''SetMyNameRequest