PircBot Class Reference

PircBotcpp is a C++ framework for writing IRC bots quickly and easily. More...

#include <PircBot.h>

Inheritance diagram for PircBot:

ReplyConstants List of all members.

Public Member Functions

virtual void ban (const char *const channel, const char *const hostmask) const throw (Exception &)
 Bans a user from a channel.
virtual void changeNick (const char *const newNick) const throw (Exception &)
 Attempt to change the current nick (nickname) of the bot when it is connected to an IRC server.
virtual void connect (const char *const hostname, const unsigned int &port, const char *const password) throw (IOException &, IrcException &, NickAlreadyInUseException &, Exception &)
 Attempt to connect to the specified IRC server using the supplied password.
virtual void connect (const char *const hostname, const unsigned int &port) throw (IOException &, IrcException &, NickAlreadyInUseException &, Exception &)
 Attempt to connect to the specified IRC server and port number.
virtual void connect (const char *const hostname) throw (IOException &, IrcException &, NickAlreadyInUseException &, Exception &)
 Attempt to connect to the specified IRC server.
virtual void deOp (const char *const channel, const char *const nick) const throw (Exception &)
 Removes operator privilidges from a user on a channel.
virtual void deVoice (const char *const channel, const char *const nick) const throw (Exception &)
 Removes voice privilidges from a user on a channel.
virtual void disconnect () const throw (Exception &)
 This method disconnects from the server cleanly by calling the quitServer() method.
virtual void dispose () throw (Exception &)
 Disposes of all thread resources used by this PircBot.
virtual const char ** getChannels (int &sizeOfArray) const throw (Exception &)
 Returns an array of all channels that we are in.
virtual const char * getFinger () const throw (Exception &)
 Gets the internal finger message of the PircBot.
virtual const char * getLogin () const throw (Exception &)
 Gets the internal login of the PircBot.
virtual unsigned int getMaxLineLength () const throw (Exception &)
 Gets the maximum length of any line that is sent via the IRC protocol.
virtual unsigned int getMessageDelay () const throw (Exception &)
 Returns the number of milliseconds that will be used to separate consecutive messages to the server from the outgoing message queue.
virtual const char * getName () const throw (Exception &)
 Gets the name of the PircBot.
virtual const char * getNick () throw (Exception &)
 Returns the current nick of the bot.
virtual unsigned int getOutgoingQueueSize () const throw (Exception &)
 Gets the number of lines currently waiting in the outgoing message Queue.
const char * getPassword () const throw (Exception &)
 Returns the last password that we used when connecting to an IRC server.
unsigned int getPort () const throw (Exception &)
 Returns the port number of the last IRC server that the PircBot tried to connect to.
const char * getServer () const throw (Exception &)
 Returns the name of the last IRC server the PircBot tried to connect to.
virtual UsergetUsers (const char *const channel, unsigned int &arraySize) const throw (Exception &)
 Returns an array of all users in the specified channel.
virtual const char * getVersion () const throw (Exception &)
 Gets the internal version of the PircBot.
virtual void handleLine (const char *const line) throw (Exception &)
 This method handles events when any line of text arrives from the server, then calling the appropriate method in the PircBot.
virtual bool isConnected () const throw (Exception &)
 Returns whether or not the PircBot is currently connected to a server.
virtual void join () const throw (Exception &)
 Block until all internal threads are done processing.
virtual void joinChannel (const char *const channel, const char *const key) const throw (Exception &)
 Joins a channel with a key.
virtual void joinChannel (const char *const channel) const throw (Exception &)
 Joins a channel.
virtual void kick (const char *const channel, const char *const nick, const char *const reason) const throw (Exception &)
 Kicks a user from a channel, giving a reason.
virtual void kick (const char *const channel, const char *const nick) const throw (Exception &)
 Kicks a user from a channel.
virtual void listChannels (const char *const parameters) const throw (Exception &)
 Issues a request for a list of all channels on the IRC server.
virtual void listChannels () const throw (Exception &)
 Issues a request for a list of all channels on the IRC server.
virtual void log (const char *const line) const throw (Exception &)
 Adds a line to the log.
virtual void onDisconnect () throw (Exception &)
 This method carries out the actions to be performed when the PircBot gets disconnected.
virtual void op (const char *const channel, const char *const nick) const throw (Exception &)
 Grants operator privilidges to a user on a channel.
void operator delete (void *p)
 All delete's will be handled through this dll.
void * operator new (unsigned int size)
 All new's will be handled through this dll.
virtual void partChannel (const char *const channel, const char *const reason) const throw (Exception &)
 Parts a channel, giving a reason.
virtual void partChannel (const char *const channel) const throw (Exception &)
 Parts a channel.
 PircBot () throw (Exception &)
 Constructs a PircBot with the default settings.
virtual void quitServer (const char *const reason) const throw (Exception &)
 Quits from the IRC server with a reason.
virtual void quitServer () const throw (Exception &)
 Quits from the IRC server.
virtual void reconnect () throw (IOException &, IrcException &, NickAlreadyInUseException &, Exception &)
 Reconnects to the IRC server that we were previously connected to.
virtual void sendAction (const char *const target, const char *const action) const throw (Exception &)
 Sends an action to the channel or to a user.
virtual void sendCTCPCommand (const char *const target, const char *const command) const throw (Exception &)
 Sends a CTCP command to a channel or user.
virtual void sendInvite (const char *const nick, const char *const channel) const throw (Exception &)
 Sends an invitation to join a channel.
virtual void sendMessage (const char *const target, const char *const message) const throw (Exception &)
 Sends a message to a channel or a private message to a user.
virtual void sendNotice (const char *const target, const char *const notice) const throw (Exception &)
 Sends a notice to the channel or to a user.
virtual void sendRawLine (const char *const line) const throw (Exception &)
 Sends a raw line to the IRC server as soon as possible, bypassing the outgoing message queue.
virtual void sendRawLineViaQueue (const char *const line) const throw (Exception &)
 Sends a raw line through the outgoing message queue.
virtual void setAutoNickChange (bool autoNickChange) throw (Exception &)
 When you connect to a server and your nick is already in use and this is set to true, a new nick will be automatically chosen.
virtual void setMessageDelay (const unsigned int &delay) throw (Exception &)
 Sets the number of milliseconds to delay between consecutive messages when there are multiple messages waiting in the outgoing message queue.
virtual void setMode (const char *const channel, const char *const mode) const throw (Exception &)
 Set the mode of a channel.
virtual void setTopic (const char *const channel, const char *const topic) const throw (Exception &)
 Set the topic for a channel.
virtual void setVerbose (const bool &verbose) throw (Exception &)
 Sets the verbose mode.
virtual void startIdentServer () const throw (Exception &)
 Starts an ident server (Identification Protocol Server, RFC 1413).
virtual void unBan (const char *const channel, const char *const hostmask) const throw (Exception &)
 Unbans a user from a channel.
virtual void voice (const char *const channel, const char *const nick) const throw (Exception &)
 Grants voice privilidges to a user on a channel.
virtual ~PircBot ()
 Default virtual destructor.

Static Public Member Functions

static void releaseMemoryOfCharArray (const char **array, const unsigned int size) throw (Exception &)
 Deallocates the memory of the array that comes from PircBot::getChannels().
static void releaseMemoryOfUserArray (User *userArray) throw (Exception &)
 Deallocates the memory of a userArray.

Protected Member Functions

virtual void onAction (const char *const sender, const char *const login, const char *const hostname, const char *const target, const char *const action) throw (Exception &)
 This method is called whenever an ACTION is sent from a user.
virtual void onChannelInfo (const char *const channel, const int &userCount, const char *const topic) throw (Exception &)
 After calling the listChannels() method in PircBot, the server will start to send us information about each channel on the server.
virtual void onConnect () throw (Exception &)
 This method is called once the PircBot has successfully connected to the IRC server.
virtual void onDeop (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const recipient) throw (Exception &)
 Called when a user (possibly us) gets operator status taken away.
virtual void onDeVoice (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const recipient) throw (Exception &)
 Called when a user (possibly us) gets voice status removed.
virtual void onFinger (const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const target) throw (Exception &)
 This method is called whenever we receive a FINGER request.
virtual void onInvite (const char *const targetNick, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const channel) throw (Exception &)
 Called when we are invited to a channel by a user.
virtual void onJoin (const char *const channel, const char *const sender, const char *const login, const char *const hostname) throw (Exception &)
 This method is called whenever someone (possibly us) joins a channel which we are on.
virtual void onKick (const char *const channel, const char *const kickerNick, const char *const kickerLogin, const char *const kickerHostname, const char *const recipientNick, const char *const reason) throw (Exception &)
 This method is called whenever someone (possibly us) is kicked from any of the channels that we are in.
virtual void onMessage (const char *const channel, const char *const sender, const char *const login, const char *const hostname, const char *const message) throw (Exception &)
 This method is called whenever a message is sent to a channel.
virtual void onMode (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const mode) throw (Exception &)
 Called when the mode of a channel is set.
virtual void onNickChange (const char *const oldNick, const char *const login, const char *const hostname, const char *const newNick) throw (Exception &)
 This method is called whenever someone (possibly us) changes nick on any of the channels that we are on.
virtual void onNotice (const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const target, const char *const notice) throw (Exception &)
 This method is called whenever we receive a notice.
virtual void onOp (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const recipient) throw (Exception &)
 Called when a user (possibly us) gets granted operator status for a channel.
virtual void onPart (const char *const channel, const char *const sender, const char *const login, const char *const hostname) throw (Exception &)
 This method is called whenever someone (possibly us) parts a channel which we are on.
virtual void onPing (const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const target, const char *const pingValue) throw (Exception &)
 This method is called whenever we receive a PING request from another user.
virtual void onPrivateMessage (const char *const sender, const char *const login, const char *const hostname, const char *const message) throw (Exception &)
 This method is called whenever a private message is sent to the PircBot.
virtual void onQuit (const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const reason) throw (Exception &)
 This method is called whenever someone (possibly us) quits from the server.
virtual void onRemoveChannelBan (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const hostmask) throw (Exception &)
 Called when a hostmask ban is removed from a channel.
virtual void onRemoveChannelKey (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const key) throw (Exception &)
 Called when a channel key is removed.
virtual void onRemoveChannelLimit (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when the user limit is removed for a channel.
virtual void onRemoveInviteOnly (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when a channel has 'invite only' removed.
virtual void onRemoveModerated (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when a channel has moderated mode removed.
virtual void onRemoveNoExternalMessages (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when a channel is set to allow messages from any user, even if they are not actually in the channel.
virtual void onRemovePrivate (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when a channel is marked as not being in private mode.
virtual void onRemoveSecret (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when a channel has 'secret' mode removed.
virtual void onRemoveTopicProtection (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when topic protection is removed for a channel.
virtual void onServerPing (const char *const response) throw (Exception &)
 The actions to perform when a PING request comes from the server.
virtual void onServerResponse (const int &code, const char *const response) throw (Exception &)
 This method is called when we receive a numeric response from the IRC server.
virtual void onSetChannelBan (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const hostmask) throw (Exception &)
 Called when a user (possibly us) gets banned from a channel.
virtual void onSetChannelKey (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const key) throw (Exception &)
 Called when a channel key is set.
virtual void onSetChannelLimit (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const int &limit) throw (Exception &)
 Called when a user limit is set for a channel.
virtual void onSetInviteOnly (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when a channel is set to 'invite only' mode.
virtual void onSetModerated (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when a channel is set to 'moderated' mode.
virtual void onSetNoExternalMessages (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when a channel is set to only allow messages from users that are in the channel.
virtual void onSetPrivate (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when a channel is marked as being in private mode.
virtual void onSetSecret (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when a channel is set to be in 'secret' mode.
virtual void onSetTopicProtection (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname) throw (Exception &)
 Called when topic protection is enabled for a channel.
virtual void onTime (const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const target) throw (Exception &)
 This method is called whenever we receive a TIME request.
virtual void onTopic (const char *const channel, const char *const topic, const char *const setBy, long date, bool changed) throw (Exception &)
 This method is called whenever a user sets the topic, or when PircBot joins a new channel and discovers its topic.
virtual void onTopic (const char *const channel, const char *const topic) throw (Exception &)
 This method is called whenever a user sets the topic, or when PircBot joins a new channel and discovers its topic.
virtual void onUnknown (const char *const line) throw (Exception &)
 This method is called whenever we receive a line from the server that the PircBot has not been programmed to recognise.
virtual void onUserList (const char *const channel, User *users, int usersArraySize) throw (Exception &)
 This method is called when we receive a user list from the server after joining a channel.
virtual void onUserMode (const char *const targetNick, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const mode) throw (Exception &)
 Called when the mode of a user is set.
virtual void onVersion (const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const target) throw (Exception &)
 This method is called whenever we receive a VERSION request.
virtual void onVoice (const char *const channel, const char *const sourceNick, const char *const sourceLogin, const char *const sourceHostname, const char *const recipient) throw (Exception &)
 Called when a user (possibly us) gets voice status granted in a channel.
virtual void setFinger (const char *const finger) throw (Exception &)
 Sets the interal finger message.
virtual void setLogin (const char *const login) throw (Exception &)
 Sets the internal login of the Bot.
virtual void setName (const char *const name) throw (Exception &)
 Sets the name of the bot, which will be used as its nick when it tries to join an IRC server.
virtual void setVersion (const char *const version) throw (Exception &)
 Sets the internal version of the Bot.

Private Member Functions

PircBotoperator= (const PircBot &pircbot)
 The assignment operator.
 PircBot (const PircBot &pircbot)
 The copy constructor.

Private Attributes

PircBotImpl * m_pimpl
 The private implementation in which you cannot get access to.

Friends

class PircBotImpl

Detailed Description

PircBotcpp is a C++ framework for writing IRC bots quickly and easily.

It provides an event-driven architecture to handle common IRC events, flood protection, DCC support, ident support, and more. The comprehensive logfile format is suitable for use with pisg to generate channel statistics.

Methods of the PircBot class can be called to send events to the IRC server that it connects to. For example, calling the sendMessage method will send a message to a channel or user on the IRC server. Multiple servers can be supported using multiple instances of PircBot.

To perform an action when the PircBot receives a normal message from the IRC server, you would override the onMessage method defined in the PircBot class. All onXYZ methods in the PircBot class are automatically called when the event XYZ happens, so you would override these if you wish to do something when it does happen.

Some event methods, such as onPing, should only really perform a specific function (i.e. respond to a PING from the server). For your convenience, such methods are already correctly implemented in the PircBot and should not normally need to be overridden. Please read the full documentation for each method to see which ones are already implemented by the PircBot class.

Please visit the PircBot homepage at http://pircbotcpp.sourceforge.net/ for full revision history, a beginners guide to creating your first PircBot and a list of some existing C++ IRC bots and clients that use the PircBotcpp framework.

Author:
Frank Mehri Hassanabad,
Version:
1.4.4.1


Constructor & Destructor Documentation

PircBot  )  throw (Exception &)
 

Constructs a PircBot with the default settings.

Your own constructors in classes which extend the PircBot abstract class should be responsible for changing the default settings if required.

Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual ~PircBot  )  [virtual]
 

Default virtual destructor.

It will disconnect you from the server call PircBot::dispose() and delete the private implementation (pimpl)

PircBot const PircBot pircbot  )  [private]
 

The copy constructor.

For now, I am not allowing this to be invoked.

Parameters:
pircbot The standard second reference


Member Function Documentation

virtual void ban const char *const   channel,
const char *const   hostmask
const throw (Exception &) [virtual]
 

Bans a user from a channel.

An example of a valid hostmask is "*!*compu@*.18hp.net". This may be used in conjunction with the kick method to permanently remove a user from a channel. Successful use of this method may require the bot to have operator status itself.

Parameters:
channel The channel to ban the user from.
hostmask A hostmask representing the user we're banning.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void changeNick const char *const   newNick  )  const throw (Exception &) [virtual]
 

Attempt to change the current nick (nickname) of the bot when it is connected to an IRC server.

After confirmation of a successful nick change, the getNick method will return the new nick.

Parameters:
newNick The new nick to use.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void connect const char *const   hostname,
const unsigned int &  port,
const char *const   password
throw (IOException &, IrcException &, NickAlreadyInUseException &, Exception &) [virtual]
 

Attempt to connect to the specified IRC server using the supplied password.

The onConnect method is called upon success.

Parameters:
hostname The hostname of the server to connect to.
port The port number to connect to on the server.
password The password to use to join the server.
Exceptions:
IOException if it was not possible to connect to the server.
IrcException if the server would not let us join it.
NickAlreadyInUseException if our nick is already in use on the server.
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void connect const char *const   hostname,
const unsigned int &  port
throw (IOException &, IrcException &, NickAlreadyInUseException &, Exception &) [virtual]
 

Attempt to connect to the specified IRC server and port number.

The onConnect method is called upon success.

Parameters:
hostname The hostname of the server to connect to.
port The port number to connect to on the server.
Exceptions:
IOException if it was not possible to connect to the server.
IrcException if the server would not let us join it.
NickAlreadyInUseException if our nick is already in use on the server.
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void connect const char *const   hostname  )  throw (IOException &, IrcException &, NickAlreadyInUseException &, Exception &) [virtual]
 

Attempt to connect to the specified IRC server.

The onConnect method is called upon success.

Parameters:
hostname The hostname of the server to connect to.
Exceptions:
IOException if it was not possible to connect to the server.
IrcException if the server would not let us join it.
NickAlreadyInUseException if our nick is already in use on the server.
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void deOp const char *const   channel,
const char *const   nick
const throw (Exception &) [virtual]
 

Removes operator privilidges from a user on a channel.

Successful use of this method may require the bot to have operator status itself.

Parameters:
channel The channel we're deopping the user on.
nick The nick of the user we are deopping.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void deVoice const char *const   channel,
const char *const   nick
const throw (Exception &) [virtual]
 

Removes voice privilidges from a user on a channel.

Successful use of this method may require the bot to have operator status itself.

Parameters:
channel The channel we're devoicing the user on.
nick The nick of the user we are devoicing.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void disconnect  )  const throw (Exception &) [virtual]
 

This method disconnects from the server cleanly by calling the quitServer() method.

Providing the PircBot was connected to an IRC server, the onDisconnect() will be called as soon as the disconnection is made by the server.

Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.
See also:
quitServer() quitServer

quitServer(const char * const reason) const quitServer

virtual void dispose  )  throw (Exception &) [virtual]
 

Disposes of all thread resources used by this PircBot.

This may be useful when writing bots or clients that use multiple servers (and therefore multiple PircBot instances) or when integrating a PircBot with an existing program.

Each PircBot runs its own threads for dispatching messages from its outgoing message queue and receiving messages from the server. Calling dispose() ensures that these threads are stopped, thus freeing up system resources.

Once a PircBot object has been disposed, it should not be used again. Attempting to use a PircBot that has been disposed may result in unpredictable behaviour.

Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual const char** getChannels int &  sizeOfArray  )  const throw (Exception &) [virtual]
 

Returns an array of all channels that we are in.

Note that if you call this method immediately after joining a new channel, the new channel may not appear in this array as it is not possible to tell if the join was successful until a response is received from the IRC server.

Release the memory through releaseMemoryOfCharArray. DO NOT try and release the memory yourself. Let releaseMemoryOfCharArray handle the release of the memory.

Parameters:
sizeOfArray The size of the array
Returns:
A string array containing the names of all channels that we are in.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual const char* getFinger  )  const throw (Exception &) [virtual]
 

Gets the internal finger message of the PircBot.

Returns:
The finger message of the PircBot.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual const char* getLogin  )  const throw (Exception &) [virtual]
 

Gets the internal login of the PircBot.

Returns:
The login of the PircBot.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual unsigned int getMaxLineLength  )  const throw (Exception &) [virtual]
 

Gets the maximum length of any line that is sent via the IRC protocol.

The IRC RFC specifies that line lengths, including the trailing
must not exceed 512 bytes. Hence, there is currently no option to change this value in PircBot. All lines greater than this length will be truncated before being sent to the IRC server.

Returns:
The maximum line length (currently fixed at 512)
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual unsigned int getMessageDelay  )  const throw (Exception &) [virtual]
 

Returns the number of milliseconds that will be used to separate consecutive messages to the server from the outgoing message queue.

Returns:
Number of milliseconds.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual const char* getName  )  const throw (Exception &) [virtual]
 

Gets the name of the PircBot.

This is the name that will be used as as a nick when we try to join servers.

Returns:
The name of the PircBot.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual const char* getNick  )  throw (Exception &) [virtual]
 

Returns the current nick of the bot.

Note that if you have just changed your nick, this method will still return the old nick until confirmation of the nick change is received from the server.

The nick returned by this method is maintained only by the PircBot class and is guaranteed to be correct in the context of the IRC server.

Returns:
The current nick of the bot.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual unsigned int getOutgoingQueueSize  )  const throw (Exception &) [virtual]
 

Gets the number of lines currently waiting in the outgoing message Queue.

If this returns 0, then the Queue is empty and any new message is likely to be sent to the IRC server immediately.

Returns:
The number of lines in the outgoing message Queue.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

const char* getPassword  )  const throw (Exception &)
 

Returns the last password that we used when connecting to an IRC server.

This does not imply that the connection attempt to the server was successful (we suggest you look at the onConnect method). A value of null is returned if the PircBot has never tried to connect to a server using a password.

Returns:
The last password that we used when connecting to an IRC server. Returns null if we have not previously connected using a password.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

unsigned int getPort  )  const throw (Exception &)
 

Returns the port number of the last IRC server that the PircBot tried to connect to.

This does not imply that the connection attempt to the server was successful (we suggest you look at the onConnect method). A value of -1 is returned if the PircBot has never tried to connect to a server.

Returns:
The port number of the last IRC server we connected to. Returns -1 if no connection attempts have ever been made.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

const char* getServer  )  const throw (Exception &)
 

Returns the name of the last IRC server the PircBot tried to connect to.

This does not imply that the connection attempt to the server was successful (we suggest you look at the onConnect method). A value of null is returned if the PircBot has never tried to connect to a server.

Returns:
The name of the last machine we tried to connect to. Returns null if no connection attempts have ever been made.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual User* getUsers const char *const   channel,
unsigned int &  arraySize
const throw (Exception &) [virtual]
 

Returns an array of all users in the specified channel.

DO NOT try and delete this pointer yourself. Instead to deallocate call releaseMemoryOfUserArray(). This is to keep everything dll boundary safe.

There are some important things to note about this method:-

  • This method may not return a full list of users if you call it before the complete nick list has arrived from the IRC server.
  • If you wish to find out which users are in a channel as soon as you join it, then you should override the onUserList method instead of calling this method, as the onUserList method is only called as soon as the full user list has been received.
  • This method will return immediately, as it does not require any interaction with the IRC server.
  • The bot must be in a channel to be able to know which users are in it.

Parameters:
channel The name of the channel to list.
arraySize The size of the array will be returned to you.
Returns:
An array of User objects. This array is NULL/0 if we are not in the channel.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.
See also:
onUserList(const char * const channel, User* users, int usersArraySize) onUserList

virtual const char* getVersion  )  const throw (Exception &) [virtual]
 

Gets the internal version of the PircBot.

Returns:
The version of the PircBot.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void handleLine const char *const   line  )  throw (Exception &) [virtual]
 

This method handles events when any line of text arrives from the server, then calling the appropriate method in the PircBot.

This method is protected and only called by the InputThread for this instance.

This method may not be overridden!

This method was protected in Java but it's public here so it can be accessed in InputThread

Parameters:
line The raw line of text from the server.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual bool isConnected  )  const throw (Exception &) [virtual]
 

Returns whether or not the PircBot is currently connected to a server.

The result of this method should only act as a rough guide, as the result may not be valid by the time you act upon it.

Returns:
True if and only if the PircBot is currently connected to a server.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void join  )  const throw (Exception &) [virtual]
 

Block until all internal threads are done processing.

Call this at the bottom of your main() if you want pircbot to continue processing without terminating your main.

You can also call this if you have a mulithreaded program and you want just one thread to block with irc processing.

To terminate the internal threads, call the PircBot::dispose() method. This will cause pircbot to shut down its threads for this join() to become unblocked.

Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void joinChannel const char *const   channel,
const char *const   key
const throw (Exception &) [virtual]
 

Joins a channel with a key.

Parameters:
channel The name of the channel to join (eg "#cs").
key The key that will be used to join the channel.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void joinChannel const char *const   channel  )  const throw (Exception &) [virtual]
 

Joins a channel.

Parameters:
channel The name of the channel to join (eg "#cs").
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void kick const char *const   channel,
const char *const   nick,
const char *const   reason
const throw (Exception &) [virtual]
 

Kicks a user from a channel, giving a reason.

This method attempts to kick a user from a channel and may require the bot to have operator status in the channel.

Parameters:
channel The channel to kick the user from.
nick The nick of the user to kick.
reason A description of the reason for kicking a user.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void kick const char *const   channel,
const char *const   nick
const throw (Exception &) [virtual]
 

Kicks a user from a channel.

This method attempts to kick a user from a channel and may require the bot to have operator status in the channel.

Parameters:
channel The channel to kick the user from.
nick The nick of the user to kick.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void listChannels const char *const   parameters  )  const throw (Exception &) [virtual]
 

Issues a request for a list of all channels on the IRC server.

When the PircBot receives information for each channel, it will call the onChannelInfo method, which you will need to override if you want it to do anything useful.

Some IRC servers support certain parameters for LIST requests. One example is a parameter of ">10" to list only those channels that have more than 10 users in them. Whether these parameters are supported or not will depend on the IRC server software.

Parameters:
parameters The parameters to supply when requesting the list.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.
See also:
onChannelInfo(const char * const channel, const int &userCount, const char * const topic) onChannelInfo

virtual void listChannels  )  const throw (Exception &) [virtual]
 

Issues a request for a list of all channels on the IRC server.

When the PircBot receives information for each channel, it will call the onChannelInfo method, which you will need to override if you want it to do anything useful.

Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.
See also:
onChannelInfo(const char * const channel, const int &userCount, const char * const topic) onChannelInfo

virtual void log const char *const   line  )  const throw (Exception &) [virtual]
 

Adds a line to the log.

This log is currently output to the standard output and is in the correct format for use by tools such as pisg, the Perl IRC Statistics Generator. You may override this method if you wish to do something else with log entries. Each line in the log begins with a number which represents the logging time This timestamp and the following log entry are separated by a single space character, " ". Outgoing messages are distinguishable by a log entry that has ">>>" immediately following the space character after the timestamp. DCC events use "+++" and warnings about unhandled Exceptions and Errors use "###".

This implementation of the method will only cause log entries to be output if the PircBot has had its verbose mode turned on by calling setVerbose(true);

Parameters:
line The line to add to the log.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onAction const char *const   sender,
const char *const   login,
const char *const   hostname,
const char *const   target,
const char *const   action
throw (Exception &) [protected, virtual]
 

This method is called whenever an ACTION is sent from a user.

E.g. such events generated by typing "/me goes shopping" in most IRC clients.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
sender The nick of the user that sent the action.
login The login of the user that sent the action.
hostname The hostname of the user that sent the action.
target The target of the action, be it a channel or our nick.
action The action carried out by the user.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onChannelInfo const char *const   channel,
const int &  userCount,
const char *const   topic
throw (Exception &) [protected, virtual]
 

After calling the listChannels() method in PircBot, the server will start to send us information about each channel on the server.

You may override this method in order to receive the information about each channel as soon as it is received.

Note that certain channels, such as those marked as hidden, may not appear in channel listings.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The name of the channel.
userCount The number of users visible in this channel.
topic The topic for this channel.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.
See also:
listChannels() listChannels

virtual void onConnect  )  throw (Exception &) [protected, virtual]
 

This method is called once the PircBot has successfully connected to the IRC server.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onDeop const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   recipient
throw (Exception &) [protected, virtual]
 

Called when a user (possibly us) gets operator status taken away.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
recipient The nick of the user that got 'deopped'.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onDeVoice const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   recipient
throw (Exception &) [protected, virtual]
 

Called when a user (possibly us) gets voice status removed.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
recipient The nick of the user that got 'devoiced'.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onDisconnect  )  throw (Exception &) [virtual]
 

This method carries out the actions to be performed when the PircBot gets disconnected.

This may happen if the PircBot quits from the server, or if the connection is unexpectedly lost.

Disconnection from the IRC server is detected immediately if either we or the server close the connection normally. If the connection to the server is lost, but neither we nor the server have explicitly closed the connection, then it may take a few minutes to detect (this is commonly referred to as a "ping timeout").

If you wish to get your IRC bot to automatically rejoin a server after the connection has been lost, then this is probably the ideal method to override to implement such functionality.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

This was protected in the Java version but I had to make it public in the C++ version since other classes were calling this method

Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onFinger const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   target
throw (Exception &) [protected, virtual]
 

This method is called whenever we receive a FINGER request.

This abstract implementation responds correctly, so if you override this method, be sure to either mimic its functionality or to call PircBot::onFinger(...);

Parameters:
sourceNick The nick of the user that sent the FINGER request.
sourceLogin The login of the user that sent the FINGER request.
sourceHostname The hostname of the user that sent the FINGER request.
target The target of the FINGER request, be it our nick or a channel name.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onInvite const char *const   targetNick,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   channel
throw (Exception &) [protected, virtual]
 

Called when we are invited to a channel by a user.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
targetNick The nick of the user being invited - should be us!
sourceNick The nick of the user that sent the invitation.
sourceLogin The login of the user that sent the invitation.
sourceHostname The hostname of the user that sent the invitation.
channel The channel that we're being invited to.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onJoin const char *const   channel,
const char *const   sender,
const char *const   login,
const char *const   hostname
throw (Exception &) [protected, virtual]
 

This method is called whenever someone (possibly us) joins a channel which we are on.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel which somebody joined.
sender The nick of the user who joined the channel.
login The login of the user who joined the channel.
hostname The hostname of the user who joined the channel.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onKick const char *const   channel,
const char *const   kickerNick,
const char *const   kickerLogin,
const char *const   kickerHostname,
const char *const   recipientNick,
const char *const   reason
throw (Exception &) [protected, virtual]
 

This method is called whenever someone (possibly us) is kicked from any of the channels that we are in.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel from which the recipient was kicked.
kickerNick The nick of the user who performed the kick.
kickerLogin The login of the user who performed the kick.
kickerHostname The hostname of the user who performed the kick.
recipientNick The unfortunate recipient of the kick.
reason The reason given by the user who performed the kick.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onMessage const char *const   channel,
const char *const   sender,
const char *const   login,
const char *const   hostname,
const char *const   message
throw (Exception &) [protected, virtual]
 

This method is called whenever a message is sent to a channel.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel to which the message was sent.
sender The nick of the person who sent the message.
login The login of the person who sent the message.
hostname The hostname of the person who sent the message.
message The actual message sent to the channel.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onMode const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   mode
throw (Exception &) [protected, virtual]
 

Called when the mode of a channel is set.

You may find it more convenient to decode the meaning of the mode string by overriding the onOp, onDeOp, onVoice, onDeVoice, onChannelKey, onDeChannelKey, onChannelLimit, onDeChannelLimit, onChannelBan or onDeChannelBan methods as appropriate.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel that the mode operation applies to.
sourceNick The nick of the user that set the mode.
sourceLogin The login of the user that set the mode.
sourceHostname The hostname of the user that set the mode.
mode The mode that has been set.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onNickChange const char *const   oldNick,
const char *const   login,
const char *const   hostname,
const char *const   newNick
throw (Exception &) [protected, virtual]
 

This method is called whenever someone (possibly us) changes nick on any of the channels that we are on.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
oldNick The old nick.
login The login of the user.
hostname The hostname of the user.
newNick The new nick.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onNotice const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   target,
const char *const   notice
throw (Exception &) [protected, virtual]
 

This method is called whenever we receive a notice.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
sourceNick The nick of the user that sent the notice.
sourceLogin The login of the user that sent the notice.
sourceHostname The hostname of the user that sent the notice.
target The target of the notice, be it our nick or a channel name.
notice The notice message.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onOp const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   recipient
throw (Exception &) [protected, virtual]
 

Called when a user (possibly us) gets granted operator status for a channel.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
recipient The nick of the user that got 'opped'.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onPart const char *const   channel,
const char *const   sender,
const char *const   login,
const char *const   hostname
throw (Exception &) [protected, virtual]
 

This method is called whenever someone (possibly us) parts a channel which we are on.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel which somebody parted from.
sender The nick of the user who parted from the channel.
login The login of the user who parted from the channel.
hostname The hostname of the user who parted from the channel.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onPing const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   target,
const char *const   pingValue
throw (Exception &) [protected, virtual]
 

This method is called whenever we receive a PING request from another user.

This abstract implementation responds correctly, so if you override this method, be sure to either mimic its functionality or to call PircBot::onPing(...);

Parameters:
sourceNick The nick of the user that sent the PING request.
sourceLogin The login of the user that sent the PING request.
sourceHostname The hostname of the user that sent the PING request.
target The target of the PING request, be it our nick or a channel name.
pingValue The value that was supplied as an argument to the PING command.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onPrivateMessage const char *const   sender,
const char *const   login,
const char *const   hostname,
const char *const   message
throw (Exception &) [protected, virtual]
 

This method is called whenever a private message is sent to the PircBot.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
sender The nick of the person who sent the private message.
login The login of the person who sent the private message.
hostname The hostname of the person who sent the private message.
message The actual message.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onQuit const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   reason
throw (Exception &) [protected, virtual]
 

This method is called whenever someone (possibly us) quits from the server.

We will only observe this if the user was in one of the channels to which we are connected.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
sourceNick The nick of the user that quit from the server.
sourceLogin The login of the user that quit from the server.
sourceHostname The hostname of the user that quit from the server.
reason The reason given for quitting the server.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onRemoveChannelBan const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   hostmask
throw (Exception &) [protected, virtual]
 

Called when a hostmask ban is removed from a channel.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
hostmask 
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onRemoveChannelKey const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   key
throw (Exception &) [protected, virtual]
 

Called when a channel key is removed.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
key The key that was in use before the channel key was removed.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onRemoveChannelLimit const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when the user limit is removed for a channel.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onRemoveInviteOnly const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when a channel has 'invite only' removed.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onRemoveModerated const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when a channel has moderated mode removed.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onRemoveNoExternalMessages const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when a channel is set to allow messages from any user, even if they are not actually in the channel.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onRemovePrivate const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when a channel is marked as not being in private mode.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onRemoveSecret const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when a channel has 'secret' mode removed.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onRemoveTopicProtection const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when topic protection is removed for a channel.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onServerPing const char *const   response  )  throw (Exception &) [protected, virtual]
 

The actions to perform when a PING request comes from the server.

This sends back a correct response, so if you override this method, be sure to either mimic its functionality or to call PircBot::onServerPing(response);

Parameters:
response The response that should be given back in your PONG.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onServerResponse const int &  code,
const char *const   response
throw (Exception &) [protected, virtual]
 

This method is called when we receive a numeric response from the IRC server.

Numerics in the range from 001 to 099 are used for client-server connections only and should never travel between servers. Replies generated in response to commands are found in the range from 200 to 399. Error replies are found in the range from 400 to 599.

For example, we can use this method to discover the topic of a channel when we join it. If we join the channel test which has a topic of "I am King of Test" then the response will be "PircBot test :I Am King of Test" with a code of 332 to signify that this is a topic. (This is just an example - note that overriding the onTopic method is an easier way of finding the topic for a channel). Check the IRC RFC for the full list of other command response codes.

PircBot implements the interface ReplyConstants, which contains contstants that you may find useful here.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
code The three-digit numerical code for the response.
response The full response from the IRC server.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.
See also:
ReplyConstants

virtual void onSetChannelBan const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   hostmask
throw (Exception &) [protected, virtual]
 

Called when a user (possibly us) gets banned from a channel.

Being banned from a channel prevents any user with a matching hostmask from joining the channel. For this reason, most bans are usually directly followed by the user being kicked :-)

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
hostmask The hostmask of the user that has been banned.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onSetChannelKey const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   key
throw (Exception &) [protected, virtual]
 

Called when a channel key is set.

When the channel key has been set, other users may only join that channel if they know the key. Channel keys are sometimes referred to as passwords.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
key The new key for the channel.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onSetChannelLimit const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const int &  limit
throw (Exception &) [protected, virtual]
 

Called when a user limit is set for a channel.

The number of users in the channel cannot exceed this limit.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
limit The maximum number of users that may be in this channel at the same time.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onSetInviteOnly const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when a channel is set to 'invite only' mode.

A user may only join the channel if they are invited by someone who is already in the channel.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onSetModerated const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when a channel is set to 'moderated' mode.

If a channel is moderated, then only users who have been 'voiced' or 'opped' may speak or change their nicks.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onSetNoExternalMessages const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when a channel is set to only allow messages from users that are in the channel.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onSetPrivate const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when a channel is marked as being in private mode.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onSetSecret const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when a channel is set to be in 'secret' mode.

Such channels typically do not appear on a server's channel listing.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onSetTopicProtection const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname
throw (Exception &) [protected, virtual]
 

Called when topic protection is enabled for a channel.

Topic protection means that only operators in a channel may change the topic.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onTime const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   target
throw (Exception &) [protected, virtual]
 

This method is called whenever we receive a TIME request.

This abstract implementation responds correctly, so if you override this method, be sure to either mimic its functionality or to call PircBot::onTime(...);

Parameters:
sourceNick The nick of the user that sent the TIME request.
sourceLogin The login of the user that sent the TIME request.
sourceHostname The hostname of the user that sent the TIME request.
target The target of the TIME request, be it our nick or a channel name.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onTopic const char *const   channel,
const char *const   topic,
const char *const   setBy,
long  date,
bool  changed
throw (Exception &) [protected, virtual]
 

This method is called whenever a user sets the topic, or when PircBot joins a new channel and discovers its topic.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel that the topic belongs to.
topic The topic for the channel.
setBy The nick of the user that set the topic.
date When the topic was set (milliseconds since the epoch).
changed True if the topic has just been changed, false if the topic was already there.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onTopic const char *const   channel,
const char *const   topic
throw (Exception &) [protected, virtual]
 

This method is called whenever a user sets the topic, or when PircBot joins a new channel and discovers its topic.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel that the topic belongs to.
topic The topic for the channel.
Deprecated:
As of 1.2.0, replaced by onTopic(const char * const channel, const char * const topic, const char * const setBy, long date, bool changed)
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onUnknown const char *const   line  )  throw (Exception &) [protected, virtual]
 

This method is called whenever we receive a line from the server that the PircBot has not been programmed to recognise.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
line The raw line that was received from the server.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onUserList const char *const   channel,
User users,
int  usersArraySize
throw (Exception &) [protected, virtual]
 

This method is called when we receive a user list from the server after joining a channel.

DO NOT try and delete the User pointer. Instead to deallocate call releaseMemoryOfUserArray(). This is to keep everything dll boundary safe.

Shortly after joining a channel, the IRC server sends a list of all users in that channel. The PircBot collects this information and calls this method as soon as it has the full list.

To obtain the nick of each user in the channel, call the getNick() method on each User object in the array.

At a later time, you may call the getUsers method to obtain an up to date list of the users in the channel.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The name of the channel.
users An array of User objects belonging to this channel.
usersArraySize The size of the users array
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.
See also:
User

virtual void onUserMode const char *const   targetNick,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   mode
throw (Exception &) [protected, virtual]
 

Called when the mode of a user is set.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
targetNick The nick that the mode operation applies to.
sourceNick The nick of the user that set the mode.
sourceLogin The login of the user that set the mode.
sourceHostname The hostname of the user that set the mode.
mode The mode that has been set.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onVersion const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   target
throw (Exception &) [protected, virtual]
 

This method is called whenever we receive a VERSION request.

This abstract implementation responds with the PircBot's _version string, so if you override this method, be sure to either mimic its functionality or to call PircBot::onVersion(...);

Parameters:
sourceNick The nick of the user that sent the VERSION request.
sourceLogin The login of the user that sent the VERSION request.
sourceHostname The hostname of the user that sent the VERSION request.
target The target of the VERSION request, be it our nick or a channel name.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void onVoice const char *const   channel,
const char *const   sourceNick,
const char *const   sourceLogin,
const char *const   sourceHostname,
const char *const   recipient
throw (Exception &) [protected, virtual]
 

Called when a user (possibly us) gets voice status granted in a channel.

This is a type of mode change and is also passed to the onMode method in the PircBot class.

The implementation of this method in the PircBot abstract class performs no actions and may be overridden as required.

Parameters:
channel The channel in which the mode change took place.
sourceNick The nick of the user that performed the mode change.
sourceLogin The login of the user that performed the mode change.
sourceHostname The hostname of the user that performed the mode change.
recipient The nick of the user that got 'voiced'.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void op const char *const   channel,
const char *const   nick
const throw (Exception &) [virtual]
 

Grants operator privilidges to a user on a channel.

Successful use of this method may require the bot to have operator status itself.

Parameters:
channel The channel we're opping the user on.
nick The nick of the user we are opping.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

void operator delete void *  p  ) 
 

All delete's will be handled through this dll.

This is required for dll boundary safety. Instead of allowing the compiler to choose if it wants to inline this we have made it so that it cannot. If we let the compiler choose to inline or not inline this and the "new operator" we can run into dll boundary issues. The issue would be that the compiler would inline one and not the other. Thus, your executable with its own heap would allocate/delete and this dll would do the other. That's a dll boundary safety violation.

Parameters:
p The pointer to an instance of this object.

Reimplemented from ReplyConstants.

void* operator new unsigned int  size  ) 
 

All new's will be handled through this dll.

This is required for dll boundary safety. Instead of allowing the compiler to choose if it wants to inline this we have made it so that it cannot. If we let the compiler choose to inline or not inline this and the "delete operator" we can run into dll boundary issues. The issue would be that the compiler would inline one and not the other. Thus, your executable with its own heap would allocate/delete and this dll would do the other. That's a dll boundary safety violation.

Parameters:
size The size to allocate an instance of this object with.
Returns:
An instance of this object

Reimplemented from ReplyConstants.

PircBot& operator= const PircBot pircbot  )  [private]
 

The assignment operator.

For now, I am not allowing a copy to be made.

Parameters:
pircbot The standard second reference.

virtual void partChannel const char *const   channel,
const char *const   reason
const throw (Exception &) [virtual]
 

Parts a channel, giving a reason.

Parameters:
channel The name of the channel to leave.
reason The reason for parting the channel.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void partChannel const char *const   channel  )  const throw (Exception &) [virtual]
 

Parts a channel.

Parameters:
channel The name of the channel to leave.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void quitServer const char *const   reason  )  const throw (Exception &) [virtual]
 

Quits from the IRC server with a reason.

Providing we are actually connected to an IRC server, the onDisconnect() method will be called as soon as the IRC server disconnects us.

Parameters:
reason The reason for quitting the server.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void quitServer  )  const throw (Exception &) [virtual]
 

Quits from the IRC server.

Providing we are actually connected to an IRC server, the onDisconnect() method will be called as soon as the IRC server disconnects us.

Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void reconnect  )  throw (IOException &, IrcException &, NickAlreadyInUseException &, Exception &) [virtual]
 

Reconnects to the IRC server that we were previously connected to.

If necessary, the appropriate port number and password will be used. This method will throw an IrcException if we have never connected to an IRC server previously.

Exceptions:
IOException if it was not possible to connect to the server.
IrcException if the server would not let us join it.
NickAlreadyInUseException if our nick is already in use on the server.
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

static void releaseMemoryOfCharArray const char **  array,
const unsigned int  size
throw (Exception &) [static]
 

Deallocates the memory of the array that comes from PircBot::getChannels().

Call this to deallocate the memory. This method ensures dll boundary safety. DO NOT try and delete the memory of array yourself. Use this method instead.

Parameters:
array The array you retrieved through a call to PircBot::getChannels() that you wish to deallocate.
size The size of the array. If you pass in an invalid size expect your program to crash.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

static void releaseMemoryOfUserArray User userArray  )  throw (Exception &) [static]
 

Deallocates the memory of a userArray.

Call to deallocate memory of a userArray such as in the call of PircBot::getUsers(). This method ensures dll boundary safety. DO NOT try and delete the memory of userArray yourself. Use this method instead.

Parameters:
userArray the array you retrieved through a call to PircBot::getUsers() that you wish to deallocate.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void sendAction const char *const   target,
const char *const   action
const throw (Exception &) [virtual]
 

Sends an action to the channel or to a user.

Parameters:
target The name of the channel or user nick to send to.
action The action to send.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.
See also:
Colors

virtual void sendCTCPCommand const char *const   target,
const char *const   command
const throw (Exception &) [virtual]
 

Sends a CTCP command to a channel or user.

(Client to client protocol). Examples of such commands are "PING <number>", "FINGER", "VERSION", etc. For example, if you wish to request the version of a user called "Dave", then you would call sendCTCPCommand("Dave", "VERSION");. The type of response to such commands is largely dependant on the target client software.

Parameters:
target The name of the channel or user to send the CTCP message to.
command The CTCP command to send.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void sendInvite const char *const   nick,
const char *const   channel
const throw (Exception &) [virtual]
 

Sends an invitation to join a channel.

Some channels can be marked as "invite-only", so it may be useful to allow a bot to invite people into it.

Parameters:
nick The nick of the user to invite
channel The channel you are inviting the user to join.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void sendMessage const char *const   target,
const char *const   message
const throw (Exception &) [virtual]
 

Sends a message to a channel or a private message to a user.

These messages are added to the outgoing message queue and sent at the earliest possible opportunity.

Some examples: -

    // Send the message "Hello!" to the channel cs.
    sendMessage("#cs", "Hello!");

    // Send a private message to Paul that says "Hi".
    sendMessage("Paul", "Hi");

You may optionally apply colours, boldness, underlining, etc to the message by using the Colors class.

Parameters:
target The name of the channel or user nick to send to.
message The message to send.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.
See also:
Colors

virtual void sendNotice const char *const   target,
const char *const   notice
const throw (Exception &) [virtual]
 

Sends a notice to the channel or to a user.

Parameters:
target The name of the channel or user nick to send to.
notice The notice to send.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void sendRawLine const char *const   line  )  const throw (Exception &) [virtual]
 

Sends a raw line to the IRC server as soon as possible, bypassing the outgoing message queue.

Parameters:
line The raw line to send to the IRC server.

virtual void sendRawLineViaQueue const char *const   line  )  const throw (Exception &) [virtual]
 

Sends a raw line through the outgoing message queue.

Parameters:
line The raw line to send to the IRC server.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void setAutoNickChange bool  autoNickChange  )  throw (Exception &) [virtual]
 

When you connect to a server and your nick is already in use and this is set to true, a new nick will be automatically chosen.

This is done by adding numbers to the end of the nick until an available nick is found.

Parameters:
autoNickChange Set to true if you want automatic nick changes during connection.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void setFinger const char *const   finger  )  throw (Exception &) [protected, virtual]
 

Sets the interal finger message.

This should be set before joining any servers.

Parameters:
finger The new finger message for the Bot.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void setLogin const char *const   login  )  throw (Exception &) [protected, virtual]
 

Sets the internal login of the Bot.

This should be set before joining any servers.

Parameters:
login The new login of the Bot.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void setMessageDelay const unsigned int &  delay  )  throw (Exception &) [virtual]
 

Sets the number of milliseconds to delay between consecutive messages when there are multiple messages waiting in the outgoing message queue.

This has a default value of 1000ms. It is a good idea to stick to this default value, as it will prevent your bot from spamming servers and facing the subsequent wrath! However, if you do need to change this delay value (not recommended), then this is the method to use.

Parameters:
delay The number of milliseconds between each outgoing message.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void setMode const char *const   channel,
const char *const   mode
const throw (Exception &) [virtual]
 

Set the mode of a channel.

This method attempts to set the mode of a channel. This may require the bot to have operator status on the channel. For example, if the bot has operator status, we can grant operator status to "Dave" on the cs channel by calling setMode("#cs", "+o Dave"); An alternative way of doing this would be to use the op method.

Parameters:
channel The channel on which to perform the mode change.
mode The new mode to apply to the channel. This may include zero or more arguments if necessary.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.
See also:
op(const char * const channel, const char * const nick) const op

virtual void setName const char *const   name  )  throw (Exception &) [protected, virtual]
 

Sets the name of the bot, which will be used as its nick when it tries to join an IRC server.

This should be set before joining any servers, otherwise the default nick will be used. You would typically call this method from the constructor of the class that extends PircBot.

The changeNick method should be used if you wish to change your nick when you are connected to a server.

Parameters:
name The new name of the Bot.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void setTopic const char *const   channel,
const char *const   topic
const throw (Exception &) [virtual]
 

Set the topic for a channel.

This method attempts to set the topic of a channel. This may require the bot to have operator status if the topic is protected.

Parameters:
channel The channel on which to perform the mode change.
topic The new topic for the channel.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void setVerbose const bool &  verbose  )  throw (Exception &) [virtual]
 

Sets the verbose mode.

If verbose mode is set to true, then log entries will be printed to the standard output. The default value is false and will result in no output. For general development, we strongly recommend setting the verbose mode to true.

Parameters:
verbose true if verbose mode is to be used. Default is false.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void setVersion const char *const   version  )  throw (Exception &) [protected, virtual]
 

Sets the internal version of the Bot.

This should be set before joining any servers.

Parameters:
version The new version of the Bot.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void startIdentServer  )  const throw (Exception &) [virtual]
 

Starts an ident server (Identification Protocol Server, RFC 1413).

Most IRC servers attempt to contact the ident server on connecting hosts in order to determine the user's identity. A few IRC servers will not allow you to connect unless this information is provided.

So when a PircBot is run on a machine that does not run an ident server, it may be necessary to call this method to start one up.

Calling this method starts up an ident server which will respond with the login provided by calling getLogin() and then shut down immediately. It will also be shut down if it has not been contacted within 60 seconds of creation.

If you require an ident response, then the correct procedure is to start the ident server and then connect to the IRC server. The IRC server may then contact the ident server to get the information it needs.

The ident server will fail to start if there is already an ident server running on port 113, or if you are running as an unprivileged user who is unable to create a server socket on that port number.

If it is essential for you to use an ident server when connecting to an IRC server, then make sure that port 113 on your machine is visible to the IRC server so that it may contact the ident server.

Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void unBan const char *const   channel,
const char *const   hostmask
const throw (Exception &) [virtual]
 

Unbans a user from a channel.

An example of a valid hostmask is "*!*compu@*.18hp.net". Successful use of this method may require the bot to have operator status itself.

Parameters:
channel The channel to unban the user from.
hostmask A hostmask representing the user we're unbanning.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual void voice const char *const   channel,
const char *const   nick
const throw (Exception &) [virtual]
 

Grants voice privilidges to a user on a channel.

Successful use of this method may require the bot to have operator status itself.

Parameters:
channel The channel we're voicing the user on.
nick The nick of the user we are voicing.
Exceptions:
Exception Will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.


Member Data Documentation

PircBotImpl* m_pimpl [private]
 

The private implementation in which you cannot get access to.

This shared_ptr holds the private methods and private member variables of this class. This makes ABI (Application Binary Interface) more resilient to change. See the private implementation idiom on the internet for more information about this.


The documentation for this class was generated from the following file:
Generated on Sun Sep 3 16:43:21 2006 for pircbotcpp by  doxygen 1.4.5