PandoraBotIRC  1.0.0
An irc bot that acts as a Pandora chatter bot
pbirc::irc::PandoraIRCBot Class Reference

Class representing a Pandora IRC bot. More...

#include <PandoraIRCBot.hpp>

Inheritance diagram for pbirc::irc::PandoraIRCBot:
pbirc::irc::IRCBot

Public Member Functions

 PandoraIRCBot ()
 Default constructor. More...
 
virtual ~PandoraIRCBot ()=default
 Default destructor. More...
 
 PandoraIRCBot (std::string const &server, std::uint16_t const &port, std::string const &nick, std::string const &chan)
 Value initialized constructor. More...
 
 PandoraIRCBot (PandoraIRCBot const &)=delete
 Copy constructor deleted. More...
 
PandoraIRCBotoperator= (PandoraIRCBot const &)
 Copy assignment disabled. More...
 
bool connect () override
 Responsible for connecting to the irc server. More...
 
void disconnect () override
 Responsible for disconnecting from the irc server. More...
 
int run () override
 Main worker function. Responsible for doing everything the bot needs to do. More...
 
void setServer (std::string const &server)
 sets server More...
 
void setNick (std::string const &nick)
 sets nick More...
 
void setPort (std::uint16_t const &port)
 sets port More...
 
void setChannel (std::string const &chan)
 sets channel More...
 
std::string getServer () const
 Gets server. More...
 
std::string getNick () const
 Gets nick. More...
 
std::uint16_t getPort () const
 Gets port. More...
 
std::string getChannel () const
 Gets channel. More...
 
void onPRIVMSG (IRCMessage const &msg)
 this callback handles PRIVMSG commands sent from the server More...
 
void onPING (IRCMessage const &msg)
 this callback handles PING commands sent from the server More...
 
void onPART (IRCMessage const &msg)
 this callback handles PART commands. More...
 
void onALL (IRCMessage const &msg)
 ALL callback. All messages go through this function. More...
 
- Public Member Functions inherited from pbirc::irc::IRCBot
 IRCBot ()=default
 Default constructor. More...
 
virtual ~IRCBot ()=default
 Virtual default destructor. More...
 

Detailed Description

Class representing a Pandora IRC bot.

his bot will connect to an IRC server and respond to users as a Pandora chatterbot.

Usage

Refer to the following snippet from main.cpp:

Constructor & Destructor Documentation

pbirc::irc::PandoraIRCBot::PandoraIRCBot ( )
inline

Default constructor.

virtual pbirc::irc::PandoraIRCBot::~PandoraIRCBot ( )
virtualdefault

Default destructor.

pbirc::irc::PandoraIRCBot::PandoraIRCBot ( std::string const &  server,
std::uint16_t const &  port,
std::string const &  nick,
std::string const &  chan 
)

Value initialized constructor.

Parameters
[in]serverthe irc server to connect to
[in]portthe port on the irc server to connect to
[in]nickthe nick the bot should use on the irc server.
[in]chanthe channel the bot should connect to
pbirc::irc::PandoraIRCBot::PandoraIRCBot ( PandoraIRCBot const &  )
delete

Copy constructor deleted.

Member Function Documentation

bool pbirc::irc::PandoraIRCBot::connect ( )
overridevirtual

Responsible for connecting to the irc server.

Implements pbirc::irc::IRCBot.

void pbirc::irc::PandoraIRCBot::disconnect ( )
overridevirtual

Responsible for disconnecting from the irc server.

Implements pbirc::irc::IRCBot.

std::string pbirc::irc::PandoraIRCBot::getChannel ( ) const
inline

Gets channel.

std::string pbirc::irc::PandoraIRCBot::getNick ( ) const
inline

Gets nick.

std::uint16_t pbirc::irc::PandoraIRCBot::getPort ( ) const
inline

Gets port.

std::string pbirc::irc::PandoraIRCBot::getServer ( ) const
inline

Gets server.

void pbirc::irc::PandoraIRCBot::onALL ( IRCMessage const &  msg)

ALL callback. All messages go through this function.

Currently outputs them in the terminal.

void pbirc::irc::PandoraIRCBot::onPART ( IRCMessage const &  msg)

this callback handles PART commands.

Says something vulgar about a user after he leaves.

Bug:
not yet implemented.
void pbirc::irc::PandoraIRCBot::onPING ( IRCMessage const &  msg)

this callback handles PING commands sent from the server

Responds with PONG

void pbirc::irc::PandoraIRCBot::onPRIVMSG ( IRCMessage const &  msg)

this callback handles PRIVMSG commands sent from the server

Responds with PandoraBot response

PandoraIRCBot& pbirc::irc::PandoraIRCBot::operator= ( PandoraIRCBot const &  )

Copy assignment disabled.

int pbirc::irc::PandoraIRCBot::run ( )
overridevirtual

Main worker function. Responsible for doing everything the bot needs to do.

Implements pbirc::irc::IRCBot.

void pbirc::irc::PandoraIRCBot::setChannel ( std::string const &  chan)
inline

sets channel

void pbirc::irc::PandoraIRCBot::setNick ( std::string const &  nick)
inline

sets nick

void pbirc::irc::PandoraIRCBot::setPort ( std::uint16_t const &  port)
inline

sets port

void pbirc::irc::PandoraIRCBot::setServer ( std::string const &  server)
inline

sets server


The documentation for this class was generated from the following files: