simpleirc-0.3.0: Simple IRC Library

Portabilityportable
Stabilityprovisional
Maintainermorfeusz8@gmail.com
Safe HaskellNone

Network.SimpleIRC.Core

Contents

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.

Synopsis

Types

type MIrc = MVar IrcServerSource

data IrcConfig Source

Constructors

IrcConfig 

Fields

cAddr :: String

Server address to connect to

cPort :: Int

Server port to connect to

cNick :: String

Nickname

cPass :: Maybe String

Optional server password

cUsername :: String

Username

cRealname :: String

Realname

cChannels :: [String]

List of channels to join on connect

cEvents :: [IrcEvent]

Events to bind

cCTCPVersion :: String

What to send on CTCP VERSION

cCTCPTime :: IO String

What to send on CTCP TIME

cPingTimeoutInterval :: Int
 

data IrcEvent Source

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

Instances

Functions

connectSource

Arguments

:: IrcConfig

Configuration

-> Bool

Run in a new thread

-> Bool

Print debug messages

-> IO (Either IOError MIrc)

IrcServer instance

Connects to a server

disconnectSource

Arguments

:: MIrc 
-> ByteString

Quit message

-> IO () 

Sends a QUIT command to the server.

reconnect :: MIrc -> IO (Either IOError MIrc)Source

Reconnects to the server.

sendRaw :: MIrc -> ByteString -> IO ()Source

Sends a raw command to the server

sendMsgSource

Arguments

:: MIrc 
-> ByteString

Channel

-> ByteString

Message

-> IO () 

Sends a message to a channel

Implements flood control according to RFC 2813, chapter 5.8

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

getPort :: MIrc -> IO IntSource

Returns the address

getUsername :: MIrc -> IO ByteStringSource

Returns the User name

getRealname :: MIrc -> IO ByteStringSource

Returns the Real name