{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
module Telegram.Bot.API.Methods.SendDice where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Proxy
import Data.Text
import GHC.Generics (Generic)
import Servant.API
import Servant.Client hiding (Response)
import Telegram.Bot.API.Internal.Utils
import Telegram.Bot.API.MakingRequests
import Telegram.Bot.API.Types
data SendDiceRequest = SendDiceRequest
{ SendDiceRequest -> SomeChatId
sendDiceChatId :: SomeChatId
, SendDiceRequest -> Maybe MessageThreadId
sendDiceMessageThreadId :: Maybe MessageThreadId
, SendDiceRequest -> Maybe Text
sendDiceEmoji :: Maybe Text
, SendDiceRequest -> Maybe Bool
sendDiceDisableNotification :: Maybe Bool
, SendDiceRequest -> Maybe Bool
sendDiceProtectContent :: Maybe Bool
, SendDiceRequest -> Maybe MessageId
sendDiceReplyToMessageId :: Maybe MessageId
, SendDiceRequest -> Maybe Bool
sendDiceAllowSendingWithoutReply :: Maybe Bool
, SendDiceRequest -> Maybe InlineKeyboardMarkup
sendDiceReplyMarkup :: Maybe InlineKeyboardMarkup
}
deriving forall x. Rep SendDiceRequest x -> SendDiceRequest
forall x. SendDiceRequest -> Rep SendDiceRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendDiceRequest x -> SendDiceRequest
$cfrom :: forall x. SendDiceRequest -> Rep SendDiceRequest x
Generic
instance ToJSON SendDiceRequest where toJSON :: SendDiceRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON SendDiceRequest where parseJSON :: Value -> Parser SendDiceRequest
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
type SendDice = "sendDice"
:> ReqBody '[JSON] SendDiceRequest
:> Post '[JSON] (Response Message)
sendDice :: SendDiceRequest -> ClientM (Response Message)
sendDice :: SendDiceRequest -> ClientM (Response Message)
sendDice = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @SendDice)