summaryrefslogtreecommitdiff
path: root/Hsbot/IRC.hs
diff options
context:
space:
mode:
authorJulien Dessaux2009-08-05 01:01:47 +0200
committerJulien Dessaux2009-08-05 01:01:47 +0200
commit1f6c64749d39eb31f171b7fa3a44cbe396bbf071 (patch)
tree23caca402ad07b849661678662f748b9e5cc7355 /Hsbot/IRC.hs
parentInitial import (diff)
downloadhsbot-1f6c64749d39eb31f171b7fa3a44cbe396bbf071.tar.gz
hsbot-1f6c64749d39eb31f171b7fa3a44cbe396bbf071.tar.bz2
hsbot-1f6c64749d39eb31f171b7fa3a44cbe396bbf071.zip
Wrote a dynamic compilation stuff that works (unable to test reboot yet)
Diffstat (limited to 'Hsbot/IRC.hs')
-rw-r--r--Hsbot/IRC.hs34
1 files changed, 34 insertions, 0 deletions
diff --git a/Hsbot/IRC.hs b/Hsbot/IRC.hs
new file mode 100644
index 0000000..094cb3f
--- /dev/null
+++ b/Hsbot/IRC.hs
@@ -0,0 +1,34 @@
+module Hsbot.IRC
+ ( IrcInput(..)
+ , IrcOutput(..)
+ , parseIrcMsg
+ )where
+
+import qualified Network.IRC as Irc
+import System.IO (Handle)
+
+import Hsbot.Core
+
+type User = String
+type Channel = String
+type Command = String
+type Args = [String]
+
+-- | Information from IRC
+data IrcInput = Cmd User Channel (Command, Maybe String) -- a regular command
+ | Line User Channel String -- a normal line of little significance
+ | Err String -- an error occured in parsing
+ deriving (Eq,Show)
+
+-- | Data that can go over the remote channel
+data IrcOutput = Str String -- a regular string
+ | Quit (Server, Handle) -- a quit message from a server
+ | Join (Server, Channel) -- joined a channel
+ | Part (Server, Channel) -- parted the channel
+ | Reboot -- reboot message sent
+ | Nil -- signifies thread death, only happens after reboot
+ deriving (Eq,Show)
+
+parseIrcMsg :: String -> IrcInput
+parseIrcMsg _ = Err "Parsing not yet implemented"
+