/* * IRCbot "Infobot" module for ZNC. * Made by Aha2Y. */ #include #include #include #include #include class CInfoBot : public CModule { public: MODCONSTRUCTOR(CInfoBot) {} virtual EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) { if (sMessage == "?ping") { PutIRC("PRIVMSG " + Channel.GetName() + " :" + Nick.GetNick() + ": Pong!"); return CONTINUE; } else if (sMessage == "?uptime") { PutIRC("PRIVMSG " + Channel.GetName() + " :The bouncer has been up for: " + CZNC::Get().GetUptime()); return CONTINUE; } else if (sMessage == "?version") { PutIRC("PRIVMSG " + Channel.GetName() + " :" + Nick.GetNick() + ": InfoBot, Running on ZNC-" + CZNC::Get().GetVersion()); return CONTINUE; } else if (sMessage.Token(0).Equals("?8ball")) { if (sMessage.Token(1).empty()) { PutIRC("PRIVMSG " + Channel.GetName() + " :" + Nick.GetNick() + "Perfix: ?8ball "); return CONTINUE; } int eightball_number = rand()%10 + 1; PutIRC("PRIVMSG " + Channel.GetName() + " :" + Nick.GetNick() + ":" + eightball_number + "Blaa"); return CONTINUE; } return CONTINUE; } }; int my_random(int min, int max) { return rand() % (max - min + 1) + min; } template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("Infobot"); } USERMODULEDEFS(CInfoBot, "Infobot by Aha2Y (BETA)")