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

Telegram.Bot.Simple.Debug

Synopsis

Bot debug tracing

traceBotDefault :: (Show model, Show action) => BotApp model action -> BotApp model action Source #

This a default bot tracing modifier that relies on

Trace Updates

traceTelegramUpdatesWith Source #

Arguments

:: (Update -> String)

How to display an update.

-> BotApp model action 
-> BotApp model action 

Trace (debug print) every Update before parsing it.

traceTelegramUpdatesJSON :: BotApp model action -> BotApp model action Source #

Trace (debug print) every update as pretty JSON value.

traceTelegramUpdatesShow :: BotApp model action -> BotApp model action Source #

Trace (debug print) every update using Show instance.

Trace bot actions

data TracedAction action Source #

A type of an action to trace.

Constructors

TracedIncomingAction action

An action that's about to be handled.

TracedIssuedAction action

An action that's just been issued by some handler.

Instances

Instances details
Eq action => Eq (TracedAction action) Source # 
Instance details

Defined in Telegram.Bot.Simple.Debug

Methods

(==) :: TracedAction action -> TracedAction action -> Bool #

(/=) :: TracedAction action -> TracedAction action -> Bool #

Show action => Show (TracedAction action) Source # 
Instance details

Defined in Telegram.Bot.Simple.Debug

Methods

showsPrec :: Int -> TracedAction action -> ShowS #

show :: TracedAction action -> String #

showList :: [TracedAction action] -> ShowS #

ppTracedAction :: Show action => TracedAction action -> String Source #

Pretty print TraceActionType.

traceBotActionsWith Source #

Arguments

:: (TracedAction action -> String)

How to display an action.

-> BotApp model action 
-> BotApp model action 

Trace (debug print) every incoming and issued action.

traceBotActionsShow :: Show action => BotApp model action -> BotApp model action Source #

Trace (debug print) bot actions using Show instance.

Trace bot state model

traceBotModelWith Source #

Arguments

:: (model -> String)

How to display a model.

-> BotApp model action 
-> BotApp model action 

Trace (debug print) bot model.

traceBotModelShow :: Show model => BotApp model action -> BotApp model action Source #

Trace (debug print) bot model using Show instance.

traceBotModelJSON :: ToJSON model => BotApp model action -> BotApp model action Source #

Trace (debug print) bot model using Show instance.

Helpers

ppAsJSON :: ToJSON a => a -> String Source #

Pretty print a value as JSON.