1 definition module IRCBot
3 from Data.Error import :: MaybeErrorString, :: MaybeError
4 from Data.Maybe import :: Maybe
6 from IRC import :: IRCMessage
11 * param: Hostname and port
12 * param: Startup commands that are sent initially. For example:
13 * [NICK "clooglebot" Nothing
14 * ,USER "cloogle" "0" "Cloogle bot"
15 * ,JOIN [("#cloogle",Nothing)]]
16 * param: Shutdown commands. For example
18 * param: Processing function
19 * param: command received by the server
22 * return: Maybe a response, the updated state and the updated world
23 * If the response is nothing the connection is closed
24 * All items in the list are sent back
26 * return: Maybe an error, the state and the new world
28 bot :: (String, Int) [IRCMessage] [IRCMessage] .a (IRCMessage -> (.a -> *(*World -> *(Maybe [IRCMessage], .a, *World)))) !*World -> *(Maybe String, .a, !*World)