packages feed

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

{-# LANGUAGE DataKinds #-}{-# LANGUAGE DeriveGeneric #-}{-# LANGUAGE TypeApplications #-}{-# LANGUAGE TypeOperators #-}module Telegram.Bot.API.Methods.SendDice 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-- ** 'sendDice'-- | Request parameters for 'sendDice'.data SendDiceRequest = SendDiceRequest  { sendDiceBusinessConnectionId :: Maybe BusinessConnectionId -- ^ Unique identifier of the business connection on behalf of which the message will be sent.  , sendDiceChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername).  , sendDiceMessageThreadId :: Maybe MessageThreadId -- ^ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only.  , sendDiceEmoji :: Maybe Text -- ^ Emoji on which the dice throw animation is based. Currently, must be one of β€œπŸŽ²β€, β€œπŸŽ―β€, β€œπŸ€β€, β€œβš½β€, β€œπŸŽ³β€, or β€œπŸŽ°β€. Dice can have values 1-6 for β€œπŸŽ²β€, β€œπŸŽ―β€ and β€œπŸŽ³β€, values 1-5 for β€œπŸ€β€ and β€œβš½β€, and values 1-64 for β€œπŸŽ°β€. Defaults to β€œπŸŽ²β€  , sendDiceDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.  , sendDiceProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding.  , sendDiceMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.  , sendDiceReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.  , sendDiceReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.  , sendDiceReplyMarkup :: 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   SendDiceRequest where toJSON = gtoJSONinstance FromJSON SendDiceRequest where parseJSON = gparseJSONtype SendDice = "sendDice"  :> ReqBody '[JSON] SendDiceRequest  :> Post '[JSON] (Response Message)-- | Use this method to send an animated emoji that--   will display a random value.--   On success, the sent Message is returned.sendDice :: SendDiceRequest ->  ClientM (Response Message)sendDice = client (Proxy @SendDice)makeDefault ''SendDiceRequest