irc-core-1.1.5: An IRC client library and text client

Safe HaskellSafe
LanguageHaskell2010

Irc.Cmd

Description

This module provides functions for constructing outgoing IRC messages from the client to the server.

Note: These functions add the required trailing newline characters.

Synopsis

Documentation

passCmd Source #

Arguments

:: ByteString

password

-> ByteString 

Construct a PASS command. This is used in the initial handshake to specify a password for the connection.

PASS password

nickCmd Source #

Arguments

:: Identifier

nickname

-> ByteString 

Construct a NICK command. This is used to specify the initial nickname as well as to change it.

NICK nickname

userCmd Source #

Arguments

:: ByteString

username

-> ByteString

realname

-> ByteString 

Construct a USER command. This is used in the initial handshake to specify username and realname.

USER username 0 * realname

operCmd Source #

Arguments

:: ByteString

name

-> ByteString

password

-> ByteString 

Construct an OPER command.

OPER name password

modeCmd Source #

Arguments

:: Identifier

target

-> [ByteString]

modes and params

-> ByteString 

Construct a MODE command

MODE target *(mode) *(modeparams)

quitCmd Source #

Arguments

:: ByteString

message

-> ByteString 

Construct a QUIT command.

QUIT quit_message

joinCmd :: Identifier -> Maybe ByteString -> ByteString Source #

Construct a JOIN command. A join command can support multiple channels separated by commas, and takes an optional channel key.

JOIN channel [key]

partCmd Source #

Arguments

:: Identifier

channel

-> ByteString

message

-> ByteString 

Construct a PART command.

PART channel message

topicCmd Source #

Arguments

:: Identifier

channel

-> ByteString

topic

-> ByteString 

Construct a TOPIC command. This is used to lookup the current topic or to change it.

TOPIC channel message

namesCmd Source #

Arguments

:: [Identifier]

channels

-> ByteString 

Construct a NAMES command.

NAMES [ channel *("," channel)

listCmd Source #

Arguments

:: [Identifier]

channels

-> ByteString 

Construct a LIST command.

LIST channel *("," channel)

inviteCmd Source #

Arguments

:: Identifier

nickname

-> Identifier

channel

-> ByteString 

Construct a INVITE command.

INVITE nickanme channel

kickCmd Source #

Arguments

:: Identifier

channel

-> Identifier

nick

-> ByteString

msg

-> ByteString 

Construct a KICK command

@KICK channel nick msg

privMsgCmd Source #

Arguments

:: Identifier

target

-> ByteString

message

-> ByteString 

Construct a PRIVMSG command. This send normal chat messages to both users as well as channels.

PRIVMSG target message

ctcpRequestCmd Source #

Arguments

:: Identifier

target

-> ByteString

command

-> ByteString

parameters

-> ByteString 

ctcpResponseCmd Source #

Arguments

:: Identifier

target

-> ByteString

command

-> ByteString

parameters

-> ByteString 

noticeCmd Source #

Arguments

:: Identifier

target

-> ByteString

message

-> ByteString 

Construct a NOTICE command. This send notice chat messages to both users as well as channels.

NOTICE target message

whoisCmd Source #

Arguments

:: Identifier

user

-> ByteString 

Construct a WHOIS command.

WHOIS user

whowasCmd Source #

Arguments

:: Identifier

user

-> ByteString 

Construct a WHOWAS command.

WHOWAS user

whoCmd Source #

Arguments

:: ByteString

mask

-> ByteString 

Construct a WHO command.

WHO mask

pongCmd Source #

Arguments

:: ByteString

token

-> ByteString 

Construct a PONG command. This is used to respond to the PING command to keep a connection alive.

PONG token

pingCmd Source #

Arguments

:: ByteString

token

-> ByteString 

Construct a PING command. This is used to respond to the PING command to keep a connection alive.

PONG token

capLsCmd :: ByteString Source #

Construct a CAP LS command. This is used during the inital connection to request a list of extensions that are supported by the server. It should be followed by CAP REQ and eventually CAP END commands.

CAP LS

capReqCmd :: [ByteString] -> ByteString Source #

Construct a CAP REQ command. This is used to request a subset of the capabilities returned in response to a CAP LS command.

CAP REQ :cap0 cap1 .. capN

capEndCmd :: ByteString Source #

Construct a CAP END command. This terminates the capability negotiation portion of the initial connection.

CAP END

authenticateCmd Source #

Arguments

:: ByteString

message

-> ByteString 

Construct an AUTHENTICATE command.

AUTHENTICATE message

awayCmd Source #

Arguments

:: ByteString

message

-> ByteString 

Construct an AWAY command.

AWAY away_message

helpCmd Source #

Arguments

:: ByteString

topic

-> ByteString 

Construct a HELP command.

HELP topic

removeCmd Source #

Arguments

:: Identifier

channel

-> Identifier

nick

-> ByteString

msg

-> ByteString 

Construct a REMOVE command

@REMOVE channel nick msg

knockCmd Source #

Arguments

:: Identifier

channel

-> ByteString 

Construct a KNOCK command.

KNOCK channel

acceptCmd Source #

Arguments

:: ByteString

nick, -nick, *

-> ByteString 

Construct an ACCEPT command.

ACCEPT nick

timeCmd Source #

Arguments

:: Maybe ByteString

server

-> ByteString 

Construct an TIME command.

TIME [server]>

adminCmd Source #

Arguments

:: Maybe ByteString

server

-> ByteString 

Construct an ADMIN command.

ADMIN [server]>

statsCmd Source #

Arguments

:: Char 
-> Maybe ByteString

target

-> ByteString 

Construct a STATS command.

STATS letter [server]>