Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Event a
- = MessageEvent (Message a)
- | ChannelJoinEvent (User a) (Channel a)
- | ChannelLeaveEvent (User a) (Channel a)
- | TopicChangeEvent Text (Channel a)
- type EventHandler a = Event a -> IO ()
- type InitEventHandler a = a -> IO (EventHandler a)
- type RunWithAdapter a = Config -> InitEventHandler a -> RunnerM ()
- class IsAdapter a where
- newtype User' a = User' {
- unwrapUser' :: User a
- newtype Channel' a = Channel' {
- unwrapChannel' :: Channel a
- newtype TimeStamp = TimeStamp {}
- data Message a = Message {}
- newtype ScriptId = ScriptId {}
- newtype AdapterId a = AdapterId {}
- applicationScriptId :: ScriptId
- type RunnerM = LoggingT IO
- verifyIdString :: String -> (String -> a) -> String -> a
- class HasScriptId s a | s -> a where
- class (IsScript m, MonadIO m) => HasConfigAccess m where
- class IsScript m where
Documentation
Representation for the types of events which can occur
MessageEvent (Message a) | |
ChannelJoinEvent (User a) (Channel a) | |
ChannelLeaveEvent (User a) (Channel a) | |
TopicChangeEvent Text (Channel a) |
type EventHandler a = Event a -> IO () Source #
type InitEventHandler a = a -> IO (EventHandler a) Source #
type RunWithAdapter a = Config -> InitEventHandler a -> RunnerM () Source #
class IsAdapter a where Source #
Basic functionality required of any adapter
adapterId :: AdapterId a Source #
Used for scoping config and logging
messageChannel :: a -> Channel a -> Text -> RunnerM () Source #
Post a message to a channel given the internal channel identifier
runWithAdapter :: RunWithAdapter a Source #
Initialize and run the bot
getUsername :: a -> User a -> RunnerM Text Source #
Resolve a username given the internal user identifier
getChannelName :: a -> Channel a -> RunnerM Text Source #
Resolve the human readable name for a channel given the internal channel identifier
resolveChannel :: a -> Text -> RunnerM (Maybe (Channel a)) Source #
Resolve to the internal channel identifier given a human readable name
MkSlack a => IsAdapter (SlackAdapter a) Source # | |
MkTelegram a => IsAdapter (TelegramAdapter a) Source # | |
User' | |
|
HasLeaves (Handlers a0) (Vector ((User' a0, Channel' a0) -> RunnerM ())) Source # | |
HasJoins (Handlers a0) (Vector ((User' a0, Channel' a0) -> RunnerM ())) Source # | |
HasLeavesFrom (Handlers a0) (HashMap Text (Vector ((User' a0, Channel' a0) -> RunnerM ()))) Source # | |
HasJoinsIn (Handlers a0) (HashMap Text (Vector ((User' a0, Channel' a0) -> RunnerM ()))) Source # | |
Get (b, Message a) (User' a) Source # | |
Get (User' a, b) (User' a) Source # | |
HasTopicChange (Handlers a0) (Vector ((Topic, Channel' a0) -> RunnerM ())) Source # | |
HasLeaves (Handlers a0) (Vector ((User' a0, Channel' a0) -> RunnerM ())) Source # | |
HasJoins (Handlers a0) (Vector ((User' a0, Channel' a0) -> RunnerM ())) Source # | |
HasTopicChangeIn (Handlers a0) (HashMap Text (Vector ((Topic, Channel' a0) -> RunnerM ()))) Source # | |
HasLeavesFrom (Handlers a0) (HashMap Text (Vector ((User' a0, Channel' a0) -> RunnerM ()))) Source # | |
HasJoinsIn (Handlers a0) (HashMap Text (Vector ((User' a0, Channel' a0) -> RunnerM ()))) Source # | |
Get (b, Message a) (Channel' a) Source # | |
Get (b, Channel' a) (Channel' a) Source # | |
contents and meta information of a recieved message
A type, basically a String, which identifies a script to the config and the logging facilities.
A type, basically a String, which identifies an adapter to the config and the logging facilities.
class HasScriptId s a | s -> a where Source #
HasScriptId (Script a0) ScriptId Source # | |
HasScriptId (BotActionState a0 d0) ScriptId Source # | |
class (IsScript m, MonadIO m) => HasConfigAccess m where Source #
Denotes a place from which we may access the configuration.
During script definition or when handling a request we can obtain the config with getConfigVal
or requireConfigVal
.
getConfigInternal :: m Config Source #
INTERNAL USE WITH CARE
Obtain the entire config structure
class IsScript m where Source #
getScriptId :: m ScriptId Source #
IsScript (ScriptDefinition a) Source # | |
IsScript (BotReacting a b) Source # | |