packages feed

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

{-# LANGUAGE DataKinds #-}{-# LANGUAGE DeriveGeneric #-}{-# LANGUAGE TypeApplications #-}{-# LANGUAGE TypeOperators #-}module Telegram.Bot.API.Methods.ForwardMessages 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-- ** 'forwardMessages'type ForwardMessages  = "forwardMessages" :> ReqBody '[JSON] ForwardMessagesRequest :> Post '[JSON] (Response [MessageId])-- | Use this method to forward multiple messages of any kind.-- If some of the specified messages can't be found or forwarded, they are skipped.-- Service messages and messages with protected content can't be forwarded.-- Album grouping is kept for forwarded messages.-- On success, an array of 'MessageId' of the sent messages is returned.forwardMessages :: ForwardMessagesRequest -> ClientM (Response [MessageId])forwardMessages = client (Proxy @ForwardMessages)-- | Request parameters for 'forwardMessages'.data ForwardMessagesRequest = ForwardMessagesRequest  { forwardMessagesChatId              :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @\@channelusername).  , forwardMessagesMessageThreadId     :: Maybe MessageThreadId -- ^ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only.  , forwardMessagesFromChatId          :: SomeChatId -- ^ Unique identifier for the chat where the original message was sent (or channel username in the format @\@channelusername).  , forwardMessagesMessageIds          :: [MessageId]  -- ^ Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.  , forwardMessagesDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.  , forwardMessagesProtectContent      :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving.  } deriving (Generic)instance ToJSON   ForwardMessagesRequest where toJSON = gtoJSONinstance FromJSON ForwardMessagesRequest where parseJSON = gparseJSONmakeDefault ''ForwardMessagesRequest