Copyright | Alexander Krupenkin 2017 |
---|---|
License | BSD3 |
Maintainer | mail@akru.me |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Bot platform type class.
Documentation
Message bot monad
class Platform a where Source #
Message bot platform. Different platforms provide message bot API, e.g. Telegram, Viber, Facebook Messenger etc. This is generalized interface to it.
trySelf :: APIToken a => Bot a () Source #
Try connection to platform API
sendMessage :: (ToMessage msg, APIToken a) => User -> msg -> Bot a () Source #
Send message to user by platform API
messageHandler :: APIToken a => (User -> Message -> Bot a b) -> Bot a c Source #
Get user updates by platform API
platformName :: a -> Text Source #
Short description of platform
class Platform a => APIToken a where Source #
Bot authentification in platform Instance of it should be writen by user
getManager :: Bot a Manager Source #
TCP-connection manager getter
forkFinallyBot :: APIToken a => Bot a b -> (Either SomeException b -> IO ()) -> Bot a ThreadId Source #
Fork bot thread with finalizer