module Web.Telegram.API.Bot.API.Stickers
(
getStickerSetM
, uploadStickerFileM
, createNewStickerSetM
, createNewStickerSetM'
, addStickerToSetM
, uploadStickerToSetM
, setStickerPositionInSetM
, deleteStickerFromSetM
, TelegramBotStickersAPI
, stickerApi
) where
import Data.Proxy
import Data.Text (Text)
import Servant.API
import Servant.Client
import Servant.Client.MultipartFormData
import Web.Telegram.API.Bot.API.Core
import Web.Telegram.API.Bot.Data
import Web.Telegram.API.Bot.Requests
import Web.Telegram.API.Bot.Responses (Response)
type TelegramBotStickersAPI =
TelegramToken :> "getStickerSet"
:> QueryParam "name" Text
:> Get '[JSON] (Response StickerSet)
:<|> TelegramToken :> "uploadStickerFile"
:> MultipartFormDataReqBody UploadStickerFileRequest
:> Post '[JSON] (Response File)
:<|> TelegramToken :> "createNewStickerSet"
:> ReqBody '[JSON] (CreateNewStickerSetRequest Text)
:> Post '[JSON] (Response Bool)
:<|> TelegramToken :> "createNewStickerSet"
:> MultipartFormDataReqBody (CreateNewStickerSetRequest FileUpload)
:> Post '[JSON] (Response Bool)
:<|> TelegramToken :> "addStickerToSet"
:> ReqBody '[JSON] (AddStickerToSetRequest Text)
:> Post '[JSON] (Response Bool)
:<|> TelegramToken :> "addStickerToSet"
:> MultipartFormDataReqBody (AddStickerToSetRequest FileUpload)
:> Post '[JSON] (Response Bool)
:<|> TelegramToken :> "setStickerPositionInSet"
:> QueryParam "sticker" Text
:> QueryParam "position" Int
:> Post '[JSON] (Response Bool)
:<|> TelegramToken :> "deleteStickerFromSet"
:> QueryParam "sticker" Text
:> Post '[JSON] (Response Bool)
stickerApi :: Proxy TelegramBotStickersAPI
stickerApi = Proxy
getStickerSet_ :: Token -> Maybe Text -> ClientM (Response StickerSet)
uploadStickerFile_ :: Token -> UploadStickerFileRequest -> ClientM (Response File)
createNewStickerSet_ :: Token -> CreateNewStickerSetRequest Text -> ClientM (Response Bool)
createNewStickerSet_' :: Token -> CreateNewStickerSetRequest FileUpload -> ClientM (Response Bool)
addStickerToSet_ :: Token -> AddStickerToSetRequest Text -> ClientM (Response Bool)
addStickerToSet_' :: Token -> AddStickerToSetRequest FileUpload -> ClientM (Response Bool)
setStickerPositionInSet_ :: Token -> Maybe Text -> Maybe Int -> ClientM (Response Bool)
deleteStickerFromSet_ :: Token -> Maybe Text -> ClientM (Response Bool)
getStickerSet_
:<|> uploadStickerFile_
:<|> createNewStickerSet_
:<|> createNewStickerSet_'
:<|> addStickerToSet_
:<|> addStickerToSet_'
:<|> setStickerPositionInSet_
:<|> deleteStickerFromSet_
= client stickerApi
getStickerSetM :: Text
-> TelegramClient (Response StickerSet)
getStickerSetM name = run_ getStickerSet_ $ Just name
uploadStickerFileM :: UploadStickerFileRequest -> TelegramClient (Response File)
uploadStickerFileM = run_ uploadStickerFile_
createNewStickerSetM :: CreateNewStickerSetRequest Text -> TelegramClient (Response Bool)
createNewStickerSetM = run_ createNewStickerSet_
createNewStickerSetM' :: CreateNewStickerSetRequest FileUpload -> TelegramClient (Response Bool)
createNewStickerSetM' = run_ createNewStickerSet_'
addStickerToSetM :: AddStickerToSetRequest Text -> TelegramClient (Response Bool)
addStickerToSetM = run_ addStickerToSet_
uploadStickerToSetM :: AddStickerToSetRequest FileUpload -> TelegramClient (Response Bool)
uploadStickerToSetM = run_ addStickerToSet_'
setStickerPositionInSetM :: Text
-> Int
-> TelegramClient (Response Bool)
setStickerPositionInSetM fileId position = asking $ \t -> setStickerPositionInSet_ t (Just fileId) (Just position)
deleteStickerFromSetM :: Text
-> TelegramClient (Response Bool)
deleteStickerFromSetM fileId = run_ deleteStickerFromSet_ (Just fileId)