summaryrefslogtreecommitdiff
path: root/Hsbot/IRC.hs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Hsbot/IRC.hs13
1 files changed, 3 insertions, 10 deletions
diff --git a/Hsbot/IRC.hs b/Hsbot/IRC.hs
index c10467e..a489ee9 100644
--- a/Hsbot/IRC.hs
+++ b/Hsbot/IRC.hs
@@ -5,11 +5,9 @@ module Hsbot.IRC
import Control.Concurrent.Chan
import Control.Monad.State
-import qualified Data.Map as M
import Hsbot.Command
import Hsbot.IRCParser
-import Hsbot.Plugin
import Hsbot.Types
import Hsbot.Utils
@@ -27,17 +25,12 @@ initServer = do
runServer :: IrcBot ()
runServer = do
chan <- gets botChannel
- plugins <- gets botPlugins
let input = readChan chan
msg <- liftIO input
case msg of
- InputMsg inputMsg -> do
- dispatchCommand $ InputMsg inputMsg
- mapM_ (sendToPlugin (InputMsg inputMsg) . snd) (M.toList plugins)
- OutputMsg outputMsg ->
- sendstr (serializeIrcMsg outputMsg)
- InternalCmd _ ->
- traceM "TODO internal command"
+ InputMsg inputMsg -> dispatchMessage $ InputMsg inputMsg
+ OutputMsg outputMsg -> sendstr (serializeIrcMsg outputMsg)
+ InternalCmd internalCmd -> processInternalCommand $ InternalCmd internalCmd
runServer
-- | Joins a chan