void eightBallBot::onMessage(ircMessage& msg) { std::string cmd = msg.message().substr(0, 6); if(!cmd.compare("!8ball")) { _utils->sendMessage(msg.channel(), replys[getRandom()]); } }
void qdbbot::onMessage(ircMessage& msg) { std::string text = msg.message(); std::cout << "qdb: message is: " << text << std::endl; std::string cmd = text.substr(0,4); if(!cmd.compare("!qdb") || !cmd.compare("!qdb") || !cmd.compare("!qdb")) { if(text.size() == 4) { qdbbot::bashQuote* q = nextBash(); if(!msg.isPrivateMsg()) { printQuote(q, msg.channel()); delete q; } } else { std::string arg = text.substr(5); int i = ::atoi(arg.c_str()); std::cout << "qdbbot: the bash arg was: " << arg << " i = " << i << std::endl; if(i == 0) { if(!msg.isPrivateMsg()) { utils->sendMessage(msg.channel(), search(arg)); } } else { qdbbot::bashQuote* q = bashNum(arg); if(!msg.isPrivateMsg()) { printQuote(q, msg.channel()); delete q; } } } } }
/*std::string OmniListCmd::resultStr() { return _results; } void OmniListCmd::clear() { _results = ""; }*/ bool OmniListCmd::exec(ircMessage& msg){ _irc->sendMessage(msg.channel(), "Loaded Plugins: " +_plugins->listLoadedPlugins()); return false; }