Safe Haskell | None |
---|---|
Language | Haskell2010 |
- getMe :: Token -> Manager -> IO (Either ServantError GetMeResponse)
- getMeM :: TelegramClient GetMeResponse
- getFile :: Token -> Text -> Manager -> IO (Either ServantError FileResponse)
- getFileM :: Text -> TelegramClient FileResponse
- getUserProfilePhotos :: Token -> Integer -> Maybe Int -> Maybe Int -> Manager -> IO (Either ServantError UserProfilePhotosResponse)
- getUserProfilePhotosM :: Integer -> Maybe Int -> Maybe Int -> TelegramClient UserProfilePhotosResponse
- 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))))))
- getApi :: Proxy TelegramBotGetAPI
Functions
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 https://api.telegram.org/file/bot<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.
getFileM :: Text -> TelegramClient FileResponse Source #
See getFile
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.
getUserProfilePhotosM :: Integer -> Maybe Int -> Maybe Int -> TelegramClient UserProfilePhotosResponse Source #
API
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