/// <summary> /// Actual command logic /// </summary> /// <param name="source">The user who triggered the command.</param> /// <param name="channel">The channel the command was triggered in.</param> /// <param name="args">The arguments to the command.</param> /// <returns></returns> protected override CommandResponseHandler execute(User source, string channel, string[] args) { string cmd = GlobalFunctions.popFromFront(ref args); string dst = GlobalFunctions.popFromFront(ref args); Helpmebot6.irc.ircPrivmsg(dst, IAL.wrapCTCP(cmd, string.Join(" ", args))); return(null); }
protected PageWatcherController() { this._watchedPageList = new ArrayList(); if ( !Helpmebot6.pagewatcherEnabled ) return; this.loadAllWatchedPages(); uint wikiRCIrc = uint.Parse( Configuration.singleton( )[ "wikimediaRcNetwork" ] ); if ( wikiRCIrc == 0 ) return; this._irc = new IAL(wikiRCIrc); this.setupEvents(); this._irc.connect(); }
private static void initialiseBot(string configFile) { string username; string password; string schema; uint port = 0; string server = username = password = schema = ""; Configuration.readHmbotConfigFile(configFile, ref server, ref username, ref password, ref port, ref schema); _dbal = DAL.singleton(server, port, username, password, schema); if (!_dbal.connect()) { // can't connect to database, DIE return; } Configuration.singleton(); debugChannel = Configuration.singleton()["channelDebug"]; _ircNetwork = uint.Parse(Configuration.singleton()["ircNetwork"]); _trigger = Configuration.singleton()["commandTrigger"]; irc = new IAL(_ircNetwork); new IrcProxy(irc, int.Parse(Configuration.singleton()["proxyPort"]), Configuration.singleton()["proxyPassword"]); PageWatcherController.instance(); setupEvents(); TimeMonitor.instance(); if (!irc.connect()) { // if can't connect to irc, die return; } new MonitorService(62167, "Helpmebot v6 (Nagios Monitor service)"); new UDPListener(4357); string[] twparms = {server, schema, irc.ircServer}; try { new Twitter().updateStatus(new Message().get("tweetStartup", twparms)); } catch(Twitterizer.TwitterizerException ex) { GlobalFunctions.errorLog( ex ); } // ciavc hook irc.privmsgEvent+=AccAi.checkCiaVcCommits; }