From b6d119cf5b14fd7198552e939d8f49b15307e74e Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 25 Apr 2010 16:43:01 +0200 Subject: Some refactoring + cosmetics. --- Hsbot/Command.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Hsbot/Command.hs') diff --git a/Hsbot/Command.hs b/Hsbot/Command.hs index 711aa32..4653618 100644 --- a/Hsbot/Command.hs +++ b/Hsbot/Command.hs @@ -42,7 +42,7 @@ dispatchMessage (InputMsg inputMsg) | isPluginCommand = do plugins <- gets botPlugins cmds <- gets botCommands - let key = tail $ head $ words getMsgContent + let key = tail . head $ words getMsgContent pluginNames = fromMaybe [] $ M.lookup key cmds plugins' = fromMaybe [] $ mapM (flip M.lookup plugins) pluginNames mapM_ (sendRunCommand $ tail getMsgContent) plugins' @@ -56,7 +56,7 @@ dispatchMessage (InputMsg inputMsg) , (head getMsgContent) == (commandPrefix config) ] sendRunCommand :: String -> Plugin -> IrcBot () sendRunCommand cmd plugin = do - sendToPlugin (InternalCmd $ IntCmd "RUN" "CORE" (pluginName plugin) cmd (Just inputMsg)) plugin + sendToPlugin (InternalCmd $ IntCmd "RUN" "CORE" (pluginName plugin) cmd inputMsg) plugin getMsgContent :: String getMsgContent = unwords . tail $ parameters inputMsg dispatchMessage _ = return () -- cgit v1.2.3