telegram-api- Telegram Bot API bindings

Safe HaskellNone





getMe :: Token -> Manager -> IO (Either ServantError GetMeResponse) Source #

A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a User object.

getFile :: Token -> Text -> Manager -> IO (Either ServantError FileResponse) Source #

Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link<token>/<file_path>, where file_path is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.

getUserProfilePhotos :: Token -> Integer -> Maybe Int -> Maybe Int -> Manager -> IO (Either ServantError UserProfilePhotosResponse) Source #

Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.


type TelegramBotGetAPI = (TelegramToken :> ("getMe" :> Get '[JSON] GetMeResponse)) :<|> ((TelegramToken :> ("getFile" :> (QueryParam "file_id" Text :> Get '[JSON] FileResponse))) :<|> (TelegramToken :> ("getUserProfilePhotos" :> (QueryParam "user_id" Integer :> (QueryParam "offset" Int :> (QueryParam "limit" Int :> Get '[JSON] UserProfilePhotosResponse)))))) Source #

Telegram Bot API

getApi :: Proxy TelegramBotGetAPI Source #

Proxy for Thelegram Bot API