make up to date with everything
[cloogle-irc.git] / IRCBot.dcl
1 definition module IRCBot
2
3 from Data.Error import :: MaybeErrorString, :: MaybeError
4 from Data.Maybe import :: Maybe
5
6 from Internet.IRC import :: IRCMessage
7
8 /*
9 * Spawn an IRC Bot
10 *
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
17 * [QUIT (Just "Bye")]
18 * param: Processing function
19 * param: command received by the server
20 * param: State
21 * param: World
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
25 * param: World
26 * return: Maybe an error, the state and the new world
27 */
28 bot :: (String, Int) [IRCMessage] [IRCMessage] .a (IRCMessage -> (.a -> *(*World -> *(Maybe [IRCMessage], .a, *World)))) !*World -> *(Maybe String, .a, !*World)