Synopsis
- data BotActionState a d = BotActionState ScriptId Config a d
- class HasAdapter s a | s -> a where
- class HasConfig s a | s -> a where
- class HasVariable s a | s -> a where
- data MessageReactionData = MessageReactionData Message Match
- class HasMatchField s a | s -> a where
- class HasMessageField s a | s -> a where
- type Topic = Text
- data ActionData d where
- data WrappedAction a = WrappedAction (ActionData d) (BotReacting a d ())
- newtype BotReacting a d r = BotReacting {}
- data Script a = Script [WrappedAction a] ScriptId Config a
- class HasActions s a | s -> a where
- newtype ScriptDefinition a r = ScriptDefinition {}
- newtype ScriptInit a = ScriptInit (ScriptId, a -> Config -> RunnerM (Script a))
- class HasMessage m where
- class HasMatch m where
- class HasTopic m where
- idLens :: Lens' a a
- class HasChannel a where
- class HasUser a where
- class AccessAdapter m where
- getSubConfFor :: HasConfigAccess m => ScriptId -> m Config
- getConfig :: HasConfigAccess m => m Config
- addReaction :: ActionData d -> BotReacting a d () -> ScriptDefinition a ()
- hear :: Regex -> BotReacting a MessageReactionData () -> ScriptDefinition a ()
- respond :: Regex -> BotReacting a MessageReactionData () -> ScriptDefinition a ()
- enter :: BotReacting a (User, Channel) () -> ScriptDefinition a ()
- exit :: BotReacting a (User, Channel) () -> ScriptDefinition a ()
- enterIn :: Text -> BotReacting a (User, Channel) () -> ScriptDefinition a ()
- exitFrom :: Text -> BotReacting a (User, Channel) () -> ScriptDefinition a ()
- topic :: BotReacting a (Topic, Channel) () -> ScriptDefinition a ()
- topicIn :: Text -> BotReacting a (Topic, Channel) () -> ScriptDefinition a ()
- customTrigger :: (Event -> Maybe d) -> BotReacting a d () -> ScriptDefinition a ()
- send :: (IsAdapter a, HasChannel m) => Text -> BotReacting a m ()
- getUsername :: (AccessAdapter m, IsAdapter (AdapterT m), MonadIO m) => User -> m Text
- resolveChannel :: (AccessAdapter m, IsAdapter (AdapterT m), MonadIO m) => Text -> m (Maybe Channel)
- getChannelName :: (AccessAdapter m, IsAdapter (AdapterT m), MonadIO m) => Channel -> m Text
- reply :: (IsAdapter a, HasMessage m) => Text -> BotReacting a m ()
- messageChannel :: (AccessAdapter m, IsAdapter (AdapterT m), MonadIO m, MonadLogger m) => Text -> Text -> m ()
- messageChannel' :: (AccessAdapter m, IsAdapter (AdapterT m), MonadIO m) => Channel -> Text -> m ()
- defineScript :: ScriptId -> ScriptDefinition a () -> ScriptInit a
- runDefinitions :: ScriptId -> ScriptDefinition a () -> a -> Config -> RunnerM (Script a)
- getData :: BotReacting a d d
- getMatch :: HasMatch m => BotReacting a m Match
- getMessage :: HasMessage m => BotReacting a m Message
- getTopic :: HasTopic m => BotReacting a m Topic
- getChannel :: HasChannel m => BotReacting a m Channel
- getUser :: HasUser m => BotReacting a m User
- getConfigVal :: (Configured a, HasConfigAccess m) => Name -> m (Maybe a)
- requireConfigVal :: (Configured a, HasConfigAccess m) => Name -> m a
- getAppConfig :: HasConfigAccess m => m Config
- getAppConfigVal :: (Configured a, HasConfigAccess m) => Name -> m (Maybe a)
- requireAppConfigVal :: (Configured a, HasConfigAccess m) => Name -> m a
- extractReaction :: BotReacting a s o -> BotReacting a s (IO o)
- extractAction :: BotReacting a () o -> ScriptDefinition a (IO o)