-- 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.2.1 -- | Messages (parsing) module module Network.SimpleIRC.Messages data IrcMessage IrcMessage :: Maybe ByteString -> Maybe ByteString -> Maybe ByteString -> Maybe ByteString -> ByteString -> ByteString -> Maybe ByteString -> Maybe ByteString -> Maybe [ByteString] -> ByteString -> IrcMessage mNick :: IrcMessage -> Maybe ByteString mUser :: IrcMessage -> Maybe ByteString mHost :: IrcMessage -> Maybe ByteString mServer :: IrcMessage -> Maybe ByteString mCode :: IrcMessage -> ByteString mMsg :: IrcMessage -> ByteString mChan :: IrcMessage -> Maybe ByteString -- | Origin of the message, this is mNick if a message was sent directly to -- the bot, otherwise if it got sent to the channel it's mChan. mOrigin :: IrcMessage -> Maybe ByteString mOther :: IrcMessage -> Maybe [ByteString] mRaw :: IrcMessage -> ByteString 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 :ACTION msg MAction :: ByteString -> ByteString -> Command -- | Parse a raw IRC message parse :: ByteString -> IrcMessage showCommand :: Command -> ByteString instance Typeable IrcMessage instance Eq Command instance Read Command instance Show Command instance Show IrcMessage -- | 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 type MIrc = MVar IrcServer type EventFunc = MIrc -> IrcMessage -> IO () data IrcConfig IrcConfig :: String -> Int -> String -> Maybe String -> String -> String -> [String] -> [IrcEvent] -> String -> IO String -> Int -> IrcConfig -- | Server address to connect to cAddr :: IrcConfig -> String -- | Server port to connect to cPort :: IrcConfig -> Int -- | Nickname cNick :: IrcConfig -> String -- | Optional server password cPass :: IrcConfig -> Maybe 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 cPingTimeoutInterval :: IrcConfig -> Int 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 :: (MIrc -> IO ()) -> IrcEvent -- | Connects to a server connect :: IrcConfig -> Bool -> Bool -> IO (Either IOError MIrc) -- | Sends a QUIT command to the server. disconnect :: MIrc -> ByteString -> IO () -- | Reconnects to the server. reconnect :: MIrc -> IO (Either IOError MIrc) -- | Sends a raw command to the server sendRaw :: MIrc -> ByteString -> IO () -- | Sends a message to a channel -- -- Please note: As of now this function doesn't provide flood control. So -- be careful with \n. sendMsg :: MIrc -> ByteString -> ByteString -> IO () sendCmd :: MIrc -> Command -> IO () addEvent :: MIrc -> IrcEvent -> IO Unique changeEvents :: MIrc -> [IrcEvent] -> IO () remEvent :: MIrc -> Unique -> IO () defaultConfig :: IrcConfig -- | Returns a list of channels currently joined. getChannels :: MIrc -> IO [ByteString] -- | Returns the current nickname. getNickname :: MIrc -> IO ByteString -- | Returns the address getAddress :: MIrc -> IO ByteString -- | Returns the address getPort :: MIrc -> IO Int -- | Returns the User name getUsername :: MIrc -> IO ByteString -- | Returns the Real name getRealname :: MIrc -> IO ByteString instance Show IrcEvent -- | Simple and efficient IRC Library module Network.SimpleIRC