The IrcBot class can connect to a channel on an IRC network. Users on the same network can send messages to the bot that are parsed by message handlers. The included handlers read digital/analog inputs and write digital outputs or echo messages back to the command sender/channel. Users can write their own message handlers inheriting from the MessageHandler class to perform different actions.

Embed: (wiki syntax)

« Back to documentation index

IrcBot Class Reference

IrcBot Class Reference

IrcBot connects to an IRC network and joins a channel. More...

#include <IrcBot.h>

Public Member Functions

 IrcBot (char *nickname, char *network, int port, char *channel)
 Create an IrcBot.
void connect ()
 Connect to the network.
void disconnect ()
 Disconnect from the network.
void add (MessageHandler *)
 Add a handler for incoming messages.
bool read ()
 Read data from internet connection, parse input and handle any incoming private messages.

Detailed Description

IrcBot connects to an IRC network and joins a channel.

Users can add message handlers which parse incoming private messages and respond to them.

Definition at line 40 of file IrcBot.h.


Constructor & Destructor Documentation

IrcBot ( char *  nickname,
char *  network,
int  port,
char *  channel 
)

Create an IrcBot.

Parameters:
nicknameBot's nickname
networkIRC network to join
portPort to connect to network on
channelChannel to connect to

Definition at line 15 of file IrcBot.cpp.


Member Function Documentation

void add ( MessageHandler handler )

Add a handler for incoming messages.

Definition at line 41 of file IrcBot.cpp.

void connect (  )

Connect to the network.

Users should have already created a network interface (Ethernet/Wifi/3G/whatever) to carry the connection.

Definition at line 26 of file IrcBot.cpp.

void disconnect (  )

Disconnect from the network.

Definition at line 33 of file IrcBot.cpp.

bool read (  )

Read data from internet connection, parse input and handle any incoming private messages.

Definition at line 45 of file IrcBot.cpp.