- realProcess :: [String] -> [String]
- realProcess ["help":xs] =
- ["type !help cmd for command specific help"
- ,"available commands: help"]
- realProcess [c:_] = [join " " ["unknown cmd: ", c, ", type !help to get help"]]
+ realProcess :: [String] *World -> ([String], *World)
+ realProcess ["help",x:xs] w = ((case x of
+ "help" =
+ [ "Usage: !help [ARG]"
+ , "Show this help, or the specific help of the argument"]
+ "ping" =
+ [ "Usage: !ping [ARG [ARG ...]]"
+ , "Ping the bot, it will pong the arguments back"]
+ "shorten" =
+ [ "Usage: !shorten URL [URL [URL ...]]"
+ , "Shorten the given urls with the cloo.gl url shortener"]
+ "query" =
+ [ "Usage: !query QUERY"
+ , "Query QUERY in cloogle and return the results"]
+ "restart" =
+ [ "Usage: !restart"
+ , "Restart the bot"]
+ x = ["Unknown command: " +++ x]
+ ), w)
+ realProcess ["help"] w = (
+ ["Type !help cmd for command specific help"
+ ,"available commands: help, ping, shorten, query"], w)
+ realProcess ["ping":xs] w = (["pong " +++ join " " xs], w)
+ realProcess ["shorten":xs] w = case xs of
+ [] = (["shorten requires at least one argument"], w)
+ xs = mapSt shorten xs w
+ realProcess ["query":xs] w = case xs of
+ [] = (["query requires one or more arguments"], w)
+ xs = (["Not implemented yet..."], 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)