44 lines
810 B
C++
44 lines
810 B
C++
#ifndef IRCBOT_H
|
|
#define IRCBOT_H
|
|
|
|
#include "user.h"
|
|
#include "message.h"
|
|
#include <QObject>
|
|
|
|
class IRCBot : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
enum{OFFLINE, ONLINE, ON_CHAN};
|
|
|
|
QString nick;
|
|
QString chan;
|
|
int status;
|
|
UserList users;
|
|
|
|
public:
|
|
IRCBot(QString nick_, QString chan_) : nick(nick_), chan(chan_), status(OFFLINE) {}
|
|
|
|
private:
|
|
void handleMessage(Message msg);
|
|
|
|
protected:
|
|
// IRC commands
|
|
QString pong(QString target);
|
|
QString join(QString theChan);
|
|
QString privateSay(QString str, QString target);
|
|
QString whois(QString nick);
|
|
QString say(QString str);
|
|
QString action(QString str);
|
|
QString quit(QString str);
|
|
|
|
public slots:
|
|
void receiveMsg(QString msg);
|
|
void disconnect();
|
|
|
|
signals:
|
|
void sendMsg(QString msg);
|
|
};
|
|
|
|
#endif // IRCBOT_H
|