telegram-bot-simple-0.14.1: Easy to use library for building Telegram bots.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Telegram.Bot.Simple.BotApp.Internal

Contents

Synopsis

Documentation

data BotApp model action Source #

A bot application.

Constructors

BotApp 

Fields

data BotJob model action Source #

A background bot job.

Constructors

BotJob 

Fields

Instances

Instances details
Functor (BotJob model) Source # 
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 #

data BotEnv model action Source #

An environment actual bot runs in.

Constructors

BotEnv 

Fields

runJobTask :: BotEnv model action -> (model -> Eff action model) -> IO () Source #

Run bot job task once.

scheduleBotJob :: BotEnv model action -> BotJob model action -> IO [ThreadId] Source #

Schedule a cron-like bot job.

scheduleBotJobs :: BotEnv model action -> [BotJob model action] -> IO [ThreadId] Source #

Schedule all bot jobs.

defaultBotEnv :: BotApp model action -> ClientEnv -> IO (BotEnv model action) Source #

Construct a default BotEnv model action for a bot.

issueAction :: BotEnv model action -> Maybe Update -> Maybe action -> IO () Source #

Issue a new action for the bot to process.

processAction :: BotApp model action -> BotEnv model action -> Maybe Update -> action -> ClientM () Source #

Process one action.

processActionJob :: BotApp model action -> BotEnv model action -> ClientM () Source #

A job to wait for the next action and process it.

processActionsIndefinitely :: BotApp model action -> BotEnv model action -> IO ThreadId Source #

Process incoming actions indefinitely.

startBotPolling :: BotApp model action -> BotEnv model action -> ClientM () Source #

Start Update polling for a bot.

startPolling :: (Update -> ClientM a) -> ClientM a Source #

Start Update polling with a given update handler.

Helpers

asyncLink :: IO a -> IO (Async a) Source #

Instead of forkIO which hides exceptions, allow users to handle those exceptions separately.

See https://github.com/fizruk/telegram-bot-simple/issues/159.