simpleirc-0.3.0: Simple IRC Library

Copyright(c) Dominik Picheta 2010
LicenseBSD3
Maintainermorfeusz8@gmail.com
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell98

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 IrcServer Source

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

connect Source

Arguments

:: IrcConfig

Configuration

-> Bool

Run in a new thread

-> Bool

Print debug messages

-> IO (Either IOError MIrc)

IrcServer instance

Connects to a server

disconnect Source

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

sendMsg Source

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 ByteString Source

Returns the current nickname.

getAddress :: MIrc -> IO ByteString Source

Returns the address

getPort :: MIrc -> IO Int Source

Returns the address

getUsername :: MIrc -> IO ByteString Source

Returns the User name

getRealname :: MIrc -> IO ByteString Source

Returns the Real name