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.
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:
-
nickname Bot's nickname network IRC network to join port Port to connect to network on channel Channel 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.
Generated on Tue Jul 12 2022 20:41:27 by 1.7.2