Archived
1
0
Fork 0
This repository has been archived on 2025-03-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
hsbot/Hsbot/IRC.hs
2009-08-06 00:09:56 +02:00

34 lines
1.1 KiB
Haskell

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 (IrcServer, Handle) -- a quit message from a server
| Join (IrcServer, Channel) -- joined a channel
| Part (IrcServer, 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"