X-Git-Url: https://git.martlubbers.net/?p=cloogle-irc.git;a=blobdiff_plain;f=cloogle.icl;h=b2c7bdfe66c0c5b346be0a04c575d8e6df952e55;hp=c4c93d96d465317f29ceefb96cb177cf1d3725ca;hb=befcf2ab2ca4e80eebcbd839ce4a0375ae9a6012;hpb=9794a1793a22bc4cc37ed9e4c69b6907dbf64762 diff --git a/cloogle.icl b/cloogle.icl index c4c93d9..b2c7bdf 100644 --- a/cloogle.icl +++ b/cloogle.icl @@ -117,6 +117,7 @@ Start w = bot ("irc.freenode.net", 6667) startup shutdown () process w process` :: (Maybe (Either IRCUser String)) IRCCommand *World -> (Maybe [IRCCommand], *World) process` (Just (Left user)) (PRIVMSG t m) w + | m == "!restart" = (Nothing, w) | m.[0] == '!' # (msgs, w) = realProcess (split " " $ m % (1, size m)) w = (Just $ map (PRIVMSG recipient) msgs, w) @@ -157,7 +158,6 @@ Start w = bot ("irc.freenode.net", 6667) startup shutdown () process w realProcess ["query":xs] w = case xs of [] = (["query requires one or more arguments"], w) xs = appFst (split "\n") $ cloogle (join " " xs) w - realProcess ["restart"] w = abort "Restarted" realProcess ["restart":_] w = (["restart takes no arguments"], w) realProcess [c:_] w = ([join " " [ "Unknown cmd: ", c, ", type !help to get help"]], w)