marvin-0.0.8: A modular chat bot

Copyright(c) Justus Adam 2016
LicenseBSD3
Maintainerdev@justus.science
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Marvin.Adapter

Description

 

Synopsis

Documentation

data Event a Source #

Representation for the types of events which can occur

Instances

HasCustoms (Handlers a0) (Vector (Event a0 -> Maybe (RunnerM ()))) Source # 

Methods

customs :: Lens' (Handlers a0) (Vector (Event a0 -> Maybe (RunnerM ()))) Source #

type EventHandler a = Event a -> IO () Source #

class IsAdapter a where Source #

Basic functionality required of any adapter

Associated Types

type User a Source #

type Channel a Source #

Methods

adapterId :: AdapterId a Source #

Used for scoping config and logging

messageChannel :: Channel a -> Text -> AdapterM a () Source #

Post a message to a channel given the internal channel identifier

initAdapter :: RunnerM a Source #

Initialize the adapter state

runWithAdapter :: RunWithAdapter a Source #

Initialize and run the bot

getUsername :: User a -> AdapterM a Text Source #

Resolve a username given the internal user identifier

getChannelName :: Channel a -> AdapterM a Text Source #

Resolve the human readable name for a channel given the internal channel identifier

resolveChannel :: Text -> AdapterM a (Maybe (Channel a)) Source #

Resolve to the internal channel identifier given a human readable name

Instances

IsAdapter ShellAdapter Source # 
MkTelegram a => IsAdapter (TelegramAdapter a) Source # 
MkSlack a => IsAdapter (SlackAdapter a) Source # 

data AdapterId a Source #

A type, basically a String, which identifies an adapter to the config and the logging facilities.

Instances