#include "botapp.h" #include "mainwindow.h" #include "ircbot.h" #include "socketirc.h" #include "console.h" BotApp::BotApp(int argc, char** argv) : nogui(false) { QString server = QString("irc.freenode.net"); int port = 6667; QString nick = QString("SparrowBotDebug"); QString chan = QString("epicsparrow"); QString pass; // parsing arguments for(int i=1; igetChan()); QObject::connect(sock, SIGNAL(receivedMsg(QString)), window->getAdvancedConsole(), SLOT(appendAdvancedMsg(QString))); QObject::connect(bot, SIGNAL(sendMsg(QString)), window->getAdvancedConsole(), SLOT(appendAdvancedMsg(QString))); QObject::connect(sock, SIGNAL(receivedMsg(QString)), window->getSimpleConsole(), SLOT(appendSimpleMsg(QString))); QObject::connect(bot, SIGNAL(sendMsg(QString)), window->getSimpleConsole(), SLOT(appendSimpleMsg(QString))); QObject::connect((QObject*)window->getAdvancedPrompt(), SIGNAL(sendMsg(QString)), sock, SLOT(sendMsg(QString))); QObject::connect((QObject*)window->getAdvancedPrompt(), SIGNAL(returnPressed()), (QObject*)window->getAdvancedPrompt(), SLOT(advancedConfirmationPerformed())); QObject::connect((QObject*)window->getSimplePrompt(), SIGNAL(sendMsg(QString)), sock, SLOT(sendMsg(QString))); QObject::connect((QObject*)window->getSimplePrompt(), SIGNAL(returnPressed()), (QObject*)window->getSimplePrompt(), SLOT(simpleConfirmationPerformed())); window->show(); } return sock->connectToServer(coreApp); } void BotApp::addModule(Module* module) { bot->addModule(module); }