telegram-bot-simple-0.2.0: Easy to use library for building Telegram bots.

Safe HaskellNone
LanguageHaskell2010

Telegram.Bot.Simple.BotApp

Synopsis

Documentation

data BotApp model action #

A bot application.

Constructors

BotApp 

Fields

data BotJob model action #

A background bot job.

Constructors

BotJob 

Fields

Instances
Functor (BotJob model) # 
Instance details

Defined in Telegram.Bot.Simple.BotApp.Internal

Methods

fmap :: (a -> b) -> BotJob model a -> BotJob model b #

(<$) :: a -> BotJob model b -> BotJob model a #

startBot :: BotApp model action -> ClientEnv -> IO (Either ServantError ()) #

Start bot with update polling in the main thread.

startBot_ :: BotApp model action -> ClientEnv -> IO () #

Like startBot, but ignores result.

startBotAsync :: BotApp model action -> ClientEnv -> IO (action -> IO ()) #

Start bot with asynchronous polling. The result is a function that allows you to send actions directly to the bot.

startBotAsync_ :: BotApp model action -> ClientEnv -> IO () #

Like startBotAsync, but ignores result.

getEnvToken :: String -> IO Token #

Get a Token from environment variable.

Common use:

getEnvToken TELEGRAM_BOT_TOKEN