| Portability | portable |
|---|---|
| Stability | provisional |
| Maintainer | morfeusz8@gmail.com |
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 ()
- defaultConfig :: 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
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.
Arguments
| :: MIrc | |
| -> ByteString | Channel |
| -> ByteString | Message |
| -> IO () |
Sends a message to a channel
Please note: As of now this function doesn't provide flood control. So be careful with \n.
Accessors
getChannels :: MIrc -> IO [ByteString]Source
Returns a list of channels currently joined.
getNickname :: MIrc -> IO ByteStringSource
Returns the current nickname.
getAddress :: MIrc -> IO ByteStringSource
Returns the address
getUsername :: MIrc -> IO ByteStringSource
Returns the User name
getRealname :: MIrc -> IO ByteStringSource
Returns the Real name