Portability | portable |
---|---|
Stability | provisional |
Maintainer | morfeusz8@gmail.com |
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 ()
- 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
- getDest :: MIrc -> IrcMessage -> IO ByteString
- getChannels :: MIrc -> IO [ByteString]
- getNickname :: MIrc -> IO ByteString
- getAddress :: MIrc -> IO ByteString
- getUsername :: MIrc -> IO ByteString
- getRealname :: MIrc -> IO ByteString
Types
IrcConfig | |
|
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 (IrcServer -> IO ()) | This event gets called whenever the connection with the server is dropped |
Functions
:: IrcConfig | Configuration |
-> Bool | Run in a new thread |
-> Bool | Print debug messages |
-> IO (Either IOError MIrc) | IrcServer instance |
Connects to a server
:: 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.
Utils
getDest :: MIrc -> IrcMessage -> IO ByteStringSource
Gets the destination, i.e if the IrcMessage was sent directly to you returns the senders nick otherwise the channel.
Accessors
getChannels :: MIrc -> IO [ByteString]Source
Returns a list of channels currently joined.
Currently this is not updated on KICK or PART.
getNickname :: MIrc -> IO ByteStringSource
Returns the current nickname.
Currently this is not updated on NICK.
getAddress :: MIrc -> IO ByteStringSource
Returns the address
getUsername :: MIrc -> IO ByteStringSource
Returns the User name
getRealname :: MIrc -> IO ByteStringSource
Returns the Real name