packages feed

telegram-bot-api-7.4.5 / src / Telegram / Bot / API / Methods / SendContact.hs

{-# LANGUAGE DataKinds #-}{-# LANGUAGE DeriveGeneric #-}{-# LANGUAGE TypeApplications #-}{-# LANGUAGE TypeOperators #-}module Telegram.Bot.API.Methods.SendContact 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-- ** 'sendContact'-- | Request parameters for 'sendContact'.data SendContactRequest = SendContactRequest  { sendContactBusinessConnectionId :: Maybe BusinessConnectionId -- ^ Unique identifier of the business connection on behalf of which the message will be sent.  , sendContactChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername).  , sendContactMessageThreadId :: Maybe MessageThreadId -- ^ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only.  , 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.  , sendContactMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.  , sendContactReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.  , sendContactReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.  , 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 Genericinstance ToJSON   SendContactRequest where toJSON = gtoJSONinstance FromJSON SendContactRequest where parseJSON = gparseJSONtype 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)makeDefault ''SendContactRequest