-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple IRC Library -- -- Simple IRC Library. This IRC Library aims to be simple and -- lightweight. @package simpleirc @version 0.1.0 module Network.SimpleIRC.Types data IrcConfig IrcConfig :: String -> Int -> String -> String -> String -> [String] -> [IrcEvent] -> String -> IO String -> IrcConfig -- | Server address to connect to cAddr :: IrcConfig -> String -- | Server port to connect to cPort :: IrcConfig -> Int -- | Nickname cNick :: IrcConfig -> String -- | Username cUsername :: IrcConfig -> String -- | Realname cRealname :: IrcConfig -> String -- | List of channels to join on connect cChannels :: IrcConfig -> [String] -- | Events to bind cEvents :: IrcConfig -> [IrcEvent] -- | What to send on CTCP VERSION cCTCPVersion :: IrcConfig -> String -- | What to send on CTCP TIME cCTCPTime :: IrcConfig -> IO String data IrcServer IrcServer :: ByteString -> Int -> ByteString -> ByteString -> ByteString -> [ByteString] -> Map Unique IrcEvent -> Maybe Handle -> Maybe ThreadId -> Chan SIrcCommand -> Bool -> String -> IO String -> IrcServer sAddr :: IrcServer -> ByteString sPort :: IrcServer -> Int sNickname :: IrcServer -> ByteString sUsername :: IrcServer -> ByteString sRealname :: IrcServer -> ByteString sChannels :: IrcServer -> [ByteString] sEvents :: IrcServer -> Map Unique IrcEvent sSock :: IrcServer -> Maybe Handle sListenThread :: IrcServer -> Maybe ThreadId sCmdChan :: IrcServer -> Chan SIrcCommand sDebug :: IrcServer -> Bool sCTCPVersion :: IrcServer -> String sCTCPTime :: IrcServer -> IO String data SIrcCommand SIrcAddEvent :: (Unique, IrcEvent) -> SIrcCommand SIrcChangeEvents :: (Map Unique IrcEvent) -> SIrcCommand SIrcRemoveEvent :: Unique -> SIrcCommand data IrcEvent -- | PRIVMSG Privmsg :: EventFunc -> IrcEvent -- | Numeric, 001, 002, 372 etc. Numeric :: EventFunc -> IrcEvent -- | PING Ping :: EventFunc -> IrcEvent -- | JOIN Join :: EventFunc -> IrcEvent -- | PART Part :: EventFunc -> IrcEvent -- | MODE Mode :: EventFunc -> IrcEvent -- | TOPIC Topic :: EventFunc -> IrcEvent -- | INVITE Invite :: EventFunc -> IrcEvent -- | KICK Kick :: EventFunc -> IrcEvent -- | QUIT Quit :: EventFunc -> IrcEvent -- | NICK Nick :: EventFunc -> IrcEvent -- | NOTICE Notice :: EventFunc -> IrcEvent -- | This event gets called on every message received RawMsg :: EventFunc -> IrcEvent -- | This event gets called whenever the connection with the server is -- dropped Disconnect :: (IrcServer -> IO ()) -> IrcEvent type EventFunc = IrcServer -> IrcMessage -> IO () data IrcMessage IrcMessage :: Maybe ByteString -> Maybe ByteString -> Maybe ByteString -> ByteString -> ByteString -> Maybe ByteString -> Maybe [ByteString] -> ByteString -> IrcMessage mNick :: IrcMessage -> Maybe ByteString mHost :: IrcMessage -> Maybe ByteString mServer :: IrcMessage -> Maybe ByteString mCode :: IrcMessage -> ByteString mMsg :: IrcMessage -> ByteString mChan :: IrcMessage -> Maybe ByteString mOther :: IrcMessage -> Maybe [ByteString] mRaw :: IrcMessage -> ByteString instance Typeable IrcMessage instance Show IrcMessage instance Show IrcEvent -- | Utils module module Network.SimpleIRC.Utils -- | If the IrcMessage was sent directly to you returns the nick otherwise -- the channel. getChan :: IrcServer -> IrcMessage -> ByteString -- | Messages module module Network.SimpleIRC.Messages data Command Command :: Command -- | PRIVMSG #chan :msg MPrivmsg :: ByteString -> ByteString -> Command -- | JOIN #chan key MJoin :: ByteString -> (Maybe ByteString) -> Command -- | PART #chan :msg MPart :: ByteString -> ByteString -> Command -- | MODE #chan +o user MMode :: ByteString -> ByteString -> (Maybe ByteString) -> Command -- | TOPIC #chan :topic MTopic :: ByteString -> (Maybe ByteString) -> Command -- | INVITE user #chan MInvite :: ByteString -> ByteString -> Command -- | KICK #chan user :msg MKick :: ByteString -> ByteString -> ByteString -> Command -- | QUIT :msg MQuit :: ByteString -> Command -- | NICK newnick MNick :: ByteString -> Command -- | NOTICE usr/#chan :msg MNotice :: ByteString -> ByteString -> Command -- | PRIVMSG usr/#chan :\x01ACTION msg\x01 MAction :: ByteString -> ByteString -> Command -- | Parse a raw IRC message parse :: ByteString -> IrcMessage showCommand :: Command -> ByteString instance Eq Command instance Read Command instance Show Command -- | For information on how to use this library please take a look at the -- readme file on github, -- http://github.com/dom96/SimpleIRC#readme. module Network.SimpleIRC.Core -- | Connects to a server connect :: IrcConfig -> Bool -> Bool -> IO (Either IOError IrcServer) -- | Sends a QUIT command to the server. disconnect :: IrcServer -> ByteString -> IO () -- | Sends a raw command to the server sendRaw :: IrcServer -> ByteString -> IO () -- | Sends a message to a channel -- -- Please note: As of now this function doesn't provide flood control. So -- be careful. sendMsg :: IrcServer -> ByteString -> ByteString -> IO () sendCmd :: IrcServer -> Command -> IO () addEvent :: IrcServer -> IrcEvent -> IO Unique changeEvents :: IrcServer -> [IrcEvent] -> IO () remEvent :: IrcServer -> Unique -> IO () defaultConfig :: IrcConfig -- | Simple and efficient IRC Library module Network.SimpleIRC