extended parsing and added bot interface, note that it does not work...
[cloogle-irc.git] / IRC.dcl
diff --git a/IRC.dcl b/IRC.dcl
index 3c5a3d1..ae14b8f 100644 (file)
--- a/IRC.dcl
+++ b/IRC.dcl
@@ -1,8 +1,10 @@
 definition module IRC
 
 definition module IRC
 
+import IRCBot
 from Data.Maybe import :: Maybe
 from Data.Either import :: Either
 from StdOverloaded import class fromInt, class toInt, class toString, class fromString
 from Data.Maybe import :: Maybe
 from Data.Either import :: Either
 from StdOverloaded import class fromInt, class toInt, class toString, class fromString
+from Text.Parsers.Simple.Core import :: Error
 
 :: IRCMessage =
        { irc_prefix :: Maybe (Either String IRCUser)
 
 :: IRCMessage =
        { irc_prefix :: Maybe (Either String IRCUser)
@@ -14,6 +16,8 @@ from StdOverloaded import class fromInt, class toInt, class toString, class from
        , irc_host :: Maybe String
        }
 
        , irc_host :: Maybe String
        }
 
+parseIRCMessage :: (String -> Either [Error] IRCMessage)
+
 instance toString IRCCommand, IRCReplies, IRCErrors, IRCMessage, IRCUser
 instance fromInt IRCReplies, IRCErrors
 instance toInt IRCReplies, IRCErrors
 instance toString IRCCommand, IRCReplies, IRCErrors, IRCMessage, IRCUser
 instance fromInt IRCReplies, IRCErrors
 instance toInt IRCReplies, IRCErrors
@@ -31,12 +35,12 @@ instance toInt IRCReplies, IRCErrors
        | KICK String String (Maybe String)
        | KILL String String
        | LINKS (Maybe (Maybe String, String))
        | KICK String String (Maybe String)
        | KILL String String
        | LINKS (Maybe (Maybe String, String))
-       | LIST [String]
+       | LIST (Maybe ([String], Maybe String))
        | LUSERS (Maybe (String, Maybe String))
        | LUSERS (Maybe (String, Maybe String))
-       | MODE String
+       | MODE String String (Maybe String) (Maybe String) (Maybe String)
        | MOTD (Maybe String)
        | NAMES [String]
        | MOTD (Maybe String)
        | NAMES [String]
-       | NICK String
+       | NICK String (Maybe String)
        | NJOIN 
        | NOTICE String String
        | OPER String String 
        | NJOIN 
        | NOTICE String String
        | OPER String String 
@@ -44,7 +48,7 @@ instance toInt IRCReplies, IRCErrors
        | PASS String
        | PING String (Maybe String)
        | PONG String (Maybe String)
        | PASS String
        | PING String (Maybe String)
        | PONG String (Maybe String)
-       | PRIVMSG String String
+       | PRIVMSG [String] String
        | QUIT (Maybe String)
        | REHASH 
        | RESTART 
        | QUIT (Maybe String)
        | REHASH 
        | RESTART 
@@ -59,7 +63,7 @@ instance toInt IRCReplies, IRCErrors
        | TIME (Maybe String)
        | TOPIC String (Maybe String)
        | TRACE (Maybe String)
        | TIME (Maybe String)
        | TOPIC String (Maybe String)
        | TRACE (Maybe String)
-       | USER String Int String
+       | USER String String String
        | USERHOST [String]
        | USERS (Maybe String)
        | VERSION (Maybe String)
        | USERHOST [String]
        | USERS (Maybe String)
        | VERSION (Maybe String)