diff options
| -rw-r--r-- | IRC.hs | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -85,14 +85,13 @@ ircEvalLoop h env = forever $ do pong x = ircWrite h "PONG" (':' : drop 6 x) ircEval :: Handle -> IrcMessage -> Env -> IO () -ircEval h msg env@(DispatchEnv state conf dispatch) = +ircEval h msg env@(DispatchEnv state _ dispatch) = case isCommand (clean msg) of - Just cmd -> dispatch cmd sendReplyMsg envWoDispatch + Just cmd -> dispatch cmd sendReplyMsg (castEnv env) Nothing -> evalServerMessage (clean msg) where - envWoDispatch = (Env state conf) isCommand ('!':xs) = Just xs isCommand _ = Nothing evalServerMessage "+x" = ircWrite h "JOIN" (currentChannel state) evalServerMessage _ = putStrLn $ show msg - sendReplyMsg = ircPrivMsg h msg envWoDispatch + sendReplyMsg = ircPrivMsg h msg (castEnv env) |
