{-# LANGUAGE DataKinds #-}{-# LANGUAGE DeriveGeneric #-}{-# LANGUAGE TypeApplications #-}{-# LANGUAGE TypeOperators #-}module Telegram.Bot.API.Methods.SendMessage 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.Types.ParseModeimport Telegram.Bot.API.Types.SomeReplyMarkupimport Telegram.Bot.API.Internal.TH-- ** '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)-- | 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@). , sendMessageMessageThreadId :: Maybe MessageThreadId -- ^ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only. , sendMessageText :: Text -- ^ Text of the message to be sent. , sendMessageParseMode :: Maybe ParseMode -- ^ Send 'MarkdownV2', 'HTML' or 'Markdown' (legacy), 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. , sendMessageProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving. , 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 = gtoJSONinstance FromJSON SendMessageRequest where parseJSON = gparseJSONmakeDefault ''SendMessageRequest