
* Rewrote the whole architecture to achieve extreme modularity * Added the ability to build a multiprotocol bot * Added cabal integration * Added configuration handling the XMonad style * Added configuration in ~/.hsbot * Refactored many many named and functions * Refactored data structures * Cleaned a big bunch of stuff
24 lines
616 B
Haskell
24 lines
616 B
Haskell
module Hsbot.Plugin
|
|
( Plugin
|
|
, PluginState (..)
|
|
) where
|
|
|
|
import Control.Concurrent
|
|
import Control.Concurrent.Chan ()
|
|
import Control.Monad.State
|
|
import qualified Data.Map as M
|
|
import IO (Handle)
|
|
|
|
import Hsbot.Message
|
|
|
|
-- | The Plugin monad
|
|
type Plugin = StateT PluginState IO
|
|
|
|
-- | A plugin state
|
|
data PluginState = PluginState
|
|
{ pluginName :: String -- The plugin's name
|
|
, pluginThreadId :: ThreadId -- The plugin thread
|
|
, pluginChan :: Chan BotMsg -- The plugin chan
|
|
, pluginHandles :: M.Map String Handle -- the plugins's handles
|
|
}
|
|
|