telegram-bot-simple-0.5.2: Easy to use library for building Telegram bots.
Safe HaskellNone
LanguageHaskell2010

Telegram.Bot.Simple.Conversation

Synopsis

Documentation

conversationBot Source #

Arguments

:: (Eq conversation, Hashable conversation) 
=> (Update -> Maybe conversation)

How to disambiguate conversations.

-> BotApp model action 
-> BotApp (HashMap (Maybe conversation) model) (Maybe conversation, action) 

Make bot to have a separate state for each conversation.

Common use (to have a separate state for each chat):

conversationBot updateChatId bot

useLatestUpdateInJobs :: BotApp model action -> BotApp (Maybe Update, model) (Maybe Update, action) Source #

Pass latest Update to all bot jobs.

This enables jobs to easily send notifications.