The telegram-api package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Warnings:

High-level bindings to the Telegram Bot API


[Skip to ReadMe]

Properties

Versions0.1.0.0, 0.1.0.1, 0.1.0.1, 0.2.0.0, 0.2.1.0, 0.2.1.1, 0.3.0.0, 0.3.1.0, 0.4.0.0, 0.4.0.1, 0.4.1.0, 0.4.2.0, 0.4.3.0, 0.4.3.1, 0.5.0.0, 0.5.0.1, 0.5.1.1, 0.5.1.2, 0.5.2.0, 0.6.0.0, 0.6.0.1, 0.6.0.2, 0.6.1.0
Change logNone available
Dependenciesaeson, base (>=4.7 && <5), either, servant, servant-client, text [details]
LicenseBSD3
CopyrightAlexey Rodiontsev (c) 2016
AuthorAlexey Rodiontsev
Maintaineralex.rodiontsev@gmail.com
CategoryWeb
Home pagehttp://github.com/klappvisor/haskell-telegram-api#readme
Source repositoryhead: git clone https://github.com/klappvisor/haskell-telegram-api
UploadedThu Jan 7 22:29:22 UTC 2016 by klappvisor

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for telegram-api-0.1.0.1

telegram-api

Build Status Hackage Hackage Dependencies Haskell Programming Language BSD3 License High-level bindings to the Telegram Bots API based on servant library. Currently supports only one way of receiving updates based on getUpdates method. Uploading stickers, documents, video, etc is not supported yet, so you can only send items which are already uploaded on the Telegram servers. See list of supported methods below in TODO section.

Usage

getMe example

import Control.Monad
import qualified Data.Text.IO as T
import Data.Maybe
import Telegram.API.Data
import Telegram.API.Responses
import Telegram.API.Bot

main :: IO ()
main = do
  Right GetMeResponse { user_result = u } <-
    getMe token
    T.putStrLn (user_first_name u)
  where token = Token "bot<token>" -- entire Token should be bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11

sendMessage example

import Control.Monad
import qualified Data.Text.IO as T
import Data.Maybe
import Telegram.API.Data
import Telegram.API.Requests
import Telegram.API.Responses
import Telegram.API.Bot

main :: IO ()
main = do
  Right MessageResponse { message_result = m } <-
    sendMessage token (SendMessageRequest chatId message (Just Markdown) Nothing Nothing)
    T.putStrLn (message_id m)
    T.putStrLn (text m)
  where token = Token "bot<token>" -- entire Token should be bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
        chatId = "<chat_id> or <@channelusername>" 
        message = "text *bold* _italic_ [github](github.com/klappvisor/haskell-telegram-api)"

TODO

General

Methods

Currently supported:

To be done: