| Copyright | (c) Dominik Picheta 2010 |
|---|---|
| License | BSD3 |
| Maintainer | morfeusz8@gmail.com |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell98 |
Network.SimpleIRC.Core
Description
For information on how to use this library please take a look at the readme file on github, http://github.com/dom96/SimpleIRC#readme.
- type MIrc = MVar IrcServer
- type EventFunc = MIrc -> IrcMessage -> IO ()
- data IrcConfig = IrcConfig {}
- data IrcEvent
- connect :: IrcConfig -> Bool -> Bool -> IO (Either IOError MIrc)
- disconnect :: MIrc -> ByteString -> IO ()
- reconnect :: MIrc -> IO (Either IOError MIrc)
- sendRaw :: MIrc -> ByteString -> IO ()
- sendMsg :: MIrc -> ByteString -> ByteString -> IO ()
- sendCmd :: MIrc -> Command -> IO ()
- addEvent :: MIrc -> IrcEvent -> IO Unique
- changeEvents :: MIrc -> [IrcEvent] -> IO ()
- remEvent :: MIrc -> Unique -> IO ()
- mkDefaultConfig :: String -> String -> IrcConfig
- getChannels :: MIrc -> IO [ByteString]
- getNickname :: MIrc -> IO ByteString
- getAddress :: MIrc -> IO ByteString
- getPort :: MIrc -> IO Int
- getUsername :: MIrc -> IO ByteString
- getRealname :: MIrc -> IO ByteString
Types
type EventFunc = MIrc -> IrcMessage -> IO () Source
Constructors
| IrcConfig | |
Fields
| |
Constructors
| Privmsg EventFunc | PRIVMSG |
| Numeric EventFunc | Numeric, 001, 002, 372 etc. |
| Ping EventFunc | PING |
| Join EventFunc | JOIN |
| Part EventFunc | PART |
| Mode EventFunc | MODE |
| Topic EventFunc | TOPIC |
| Invite EventFunc | INVITE |
| Kick EventFunc | KICK |
| Quit EventFunc | QUIT |
| Nick EventFunc | NICK |
| Notice EventFunc | NOTICE |
| RawMsg EventFunc | This event gets called on every message received |
| Disconnect (MIrc -> IO ()) | This event gets called whenever the connection with the server is dropped |
Functions
Arguments
| :: IrcConfig | Configuration |
| -> Bool | Run in a new thread |
| -> Bool | Print debug messages |
| -> IO (Either IOError MIrc) | IrcServer instance |
Connects to a server
Arguments
| :: MIrc | |
| -> ByteString | Quit message |
| -> IO () |
Sends a QUIT command to the server.
sendRaw :: MIrc -> ByteString -> IO () Source
Sends a raw command to the server
Arguments
| :: MIrc | |
| -> ByteString | Channel |
| -> ByteString | Message |
| -> IO () |
Sends a message to a channel
Implements flood control according to RFC 2813, chapter 5.8
changeEvents :: MIrc -> [IrcEvent] -> IO () Source
mkDefaultConfig :: String -> String -> IrcConfig Source
Accessors
getChannels :: MIrc -> IO [ByteString] Source
Returns a list of channels currently joined.
getNickname :: MIrc -> IO ByteString Source
Returns the current nickname.
getAddress :: MIrc -> IO ByteString Source
Returns the address
getUsername :: MIrc -> IO ByteString Source
Returns the User name
getRealname :: MIrc -> IO ByteString Source
Returns the Real name