public List <string> OnChannelMessage(IrcBot ircBot, string server, string channel, IrcMessage m) { var sender = m.Sender.ToLower(); if (!_history.HistoryByServer.ContainsKey(m.Server)) { _history.HistoryByServer.Add(m.Server, new Dictionary <string, HistoryEntry>()); } if (_history.HistoryByServer[m.Server].ContainsKey(sender)) { _history.HistoryByServer[m.Server][sender] = new HistoryEntry { Channel = m.Channel, Time = DateTime.Now, Message = m.Text }; } else { _history.HistoryByServer[m.Server].Add(sender, new HistoryEntry { Channel = m.Channel, Time = DateTime.Now, Message = m.Text }); } _history.SaveHeartbeat(); return(null); }
public List <string> IrcCommand(IrcBot ircBot, string serverName, IrcMessage m) { var messageParts = m.Text.Split(' '); var message = string.Join(" ", messageParts.Skip(2)); if (messageParts.Length < 3) { return(HelpText()); } if (!_notes.NotesByServer.ContainsKey(serverName)) { _notes.NotesByServer.Add(serverName, new List <NoteEntry>()); } var note = new NoteEntry { Recipient = messageParts[1], Message = message, Sender = m.Sender, Time = DateTime.Now }; _notes.NotesByServer[serverName].Add(note); _notes.Save(); return(new List <string> { String.Format("Your note to {0} has been added.", messageParts[1]) }); }
public List <string> IrcCommand(IrcBot ircBot, string server, IrcMessage m) { var targets = m.TextArray.Skip(1); var message = new List <string>(); if (!_history.HistoryByServer.ContainsKey(m.Server)) { return(null); } var history = _history.HistoryByServer[m.Server]; foreach (var target in targets) { if (history.ContainsKey(target.ToLower())) { var entry = history[target.ToLower()]; message.Add(string.Format("{0} was last seen {1} in {2} saying: {3}", target.ToLower(), entry.Time.TimeSince(), entry.Channel, entry.Message)); } else { message.Add(string.Format("I cannot remember seeing {0} on this server.", target)); } } return(message); }
public SettingCommands(IrcBot bot) { this.bot = bot; this.bot.AddCommand(new Commandlet("!nick", "the command !nick <new nickname> changes the nick, not only temporarily but also in the settings", ChangeNick, this, CommandScope.Both, "nick_change_access")); this.bot.AddCommand(new Commandlet("!get", "the command !get can read bot settings", ConfigGet, this, CommandScope.Both, "config_get_access")); this.bot.AddCommand(new Commandlet("!set", "the command !set can change bot settings", ConfigSet, this, CommandScope.Both, "config_set_access")); }
private void ChannelMessage(object source, IrcBot ircBot, IrcMessage m) { if (string.IsNullOrWhiteSpace(m.Text)) { return; } var serverConfig = _connections[ircBot]; var servername = serverConfig.Address; var firstWord = m.TextArray[0].ToLower(); var channelName = m.Channel; if (serverConfig.ActivePlugins == null) { return; } var relevantPlugins = _pluginManager.Plugins.Where(plugin => serverConfig.ActivePlugins.Contains(plugin.Name)); foreach (var plugin in relevantPlugins) { SendReplies(plugin.OnChannelMessage(ircBot, servername, channelName, m), ircBot, m.Channel, source); if (firstWord[0].ToString(CultureInfo.InvariantCulture) == _configuration.CommandSymbol) { var command = firstWord.Substring(1); if (plugin.Commands.Contains(command)) { SendReplies(plugin.IrcCommand(ircBot, servername, m), ircBot, m.Channel, source); } } } }
public SimpleTrigger(IrcBot b, String t, int i) { Bot = b; AnswerString = t; Interval = i; Secs = 0; }
protected PiVoteAction(IrcBot botMethods, VotingClient client, CertificateStorage certificateStorage, IrcEventArgs eventArgs) { BotMethods = botMethods; Client = client; CertificateStorage = certificateStorage; EventArgs = eventArgs; }
public ClientInput(IrcBot b) { Bot = b; CIt = new Thread(Run); CIt.Start(); IsRunning = true; }
public List <string> IrcCommand(IrcBot ircBot, string server, IrcMessage m) { var response = new List <string>(); var mesasge = m.Text; var messageParts = mesasge.Split(' '); if (messageParts.Length < 2) { return(new List <string> { "Usage: e <poolsize> [poolsize]..." }); } foreach (var messagePart in messageParts) { int poolSize; if (int.TryParse(messagePart, out poolSize)) { if (poolSize > 2000) { response.Add("No Pools over 2000."); } else { response.Add(string.Format("{0} -- {1}", m.Sender, RollPool(poolSize))); } } } return(response); }
private void OutputUrlTitle(string url, IrcBot ircBot, string channel) { try { const string twitterStatusRegex = @"twitter.com/\w+/status/\d+"; string message; if (Regex.IsMatch(url, twitterStatusRegex)) { message = GetTwitterMessage(url); } else { message = GetWebPageTitle(url); } if (message != null) { ircBot.SendMessage(channel, message); } } catch { //Console.WriteLine(e.Message); } }
public static void Main(string[] args) { IrcBot bot = null; try { // Write information about program. Console.WriteLine(ProgramInfo.AssemblyTitle); Console.WriteLine("Version {0}", ProgramInfo.AssemblyVersion); Console.WriteLine(ProgramInfo.AssemblyCopyright); Console.WriteLine(); // Create and run bot. bot = new TwitterBot(); bot.Run(); } #if !DEBUG catch (Exception ex) { ConsoleUtilities.WriteError("Fatal error: " + ex.Message); Environment.ExitCode = 1; } #endif finally { if (bot != null) { bot.Dispose(); } } }
public MessagePRIVMSG(IrcBot b) { Bot = b; ChannelTriggers = new Hashtable(); LoadChannelTriggers(); PMTriggers = new Hashtable(); }
void MainFormLoad(object sender, EventArgs e) { irClient = new IrcBot(xl.MainNick); irClient.OnConnectEvent += irc_OnConnectEvent; irClient.OnMotdEvent += irc_OnMotEvent; irClient.OnChannelMessageEvent += irc_OnChannelMessageEvent; irClient.OnChannelMessageEvent += irClient_OnChannelMessageEvent; irClient.OnQueryMessageEvent += irClient_OnQueryMessageEvent; irClient.OnCtcpResponseEvent += irClient_OnCtcpResponseEvent; irClient.OnNamereplyEvent += irClient_OnNamereplyEvent; irClient.OnPartChannelEvent += irClient_OnPartChannelEvent; irClient.OnTopicMessageEvent += irClient_OnTopicMessageEvent; irClient.OnNoticeEvent += irClient_OnNoticeEvent; irClient.OnTopicChangedMessageEvent += irClient_OnTopicChangedMessageEvent; irClient.OnNickChangeEvent += irClient_OnNickChangeEvent; irClient.OnJoinChannelEvent += irClient_OnJoinChannelEvent; irClient.OnActionEvent += irClient_OnActionEvent; this.button2.Text = xl.MainNick; if (xl.Version != "") { irClient.VersionMessage = xl.Version; } else { irClient.VersionMessage = "AxeChat v. 11.5.15 [" + System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") + "] using RobbingHood Library."; } List <string> ch = new List <string>(); ch.Add(xl.LastChan); irClient.Connect(xl.Server, 6660, true, ch); }
public Parser(IrcBot b) { Bot = b; Replies = new Hashtable(); NickMatcher = new Regex("[^:! ]+"); LoadReplies(); }
/// <summary> /// Please only implement a Constructor with one Argument of type IrcBot /// </summary> /// <param name="botInstance"></param> protected AbstractPlugin(IrcBot botInstance) { BotMethods = botInstance; BotEvents = new SharedClientSide(botInstance); AppDomain.CurrentDomain.DomainUnload += AppDomain_CurrentDomain_DomainUnload; }
public List <string> IrcCommand(IrcBot ircBot, string server, IrcMessage m) { var text = m.Text.Trim(); var messageParts = text.Split(' '); List <string> response = new List <string> { }; var user = m.Sender; if (messageParts.Length == 1) { return(new List <string> { "Please supply a location." }); } var location = string.Join(" ", messageParts.Skip(1)); Coordinates coordinates; try { coordinates = _geoLookup.Lookup(location); } catch (Exception e) { Console.WriteLine("Weather Lookup failure: " + e.Message); if (e.InnerException != null && !string.IsNullOrWhiteSpace(e.InnerException.Message)) { Console.WriteLine("--> " + e.InnerException.Message); } return(new List <string> { "Could not find " + location }); } TimeData timeData; try { timeData = _timeLookup.Lookup(coordinates.Latitude, coordinates.Longitude); } catch (Exception e) { Console.WriteLine("Time Lookup failure: " + e.Message); if (e.InnerException != null && !string.IsNullOrWhiteSpace(e.InnerException.Message)) { Console.WriteLine("--> " + e.InnerException.Message); } return(new List <string> { "Could not find Time for " + coordinates.Name }); } response.Add($"Time for {coordinates.Name}: {TimeFromEpoch(timeData.timestamp)} {timeData.abbreviation}. GMT Offset {SecondsToHours(timeData.gmtOffset)} Hours."); return(response); }
public OutQueue(IrcBot b) { Bot = b; NQueue = new Queue<string>(); nq_timer = new System.Timers.Timer(100); nq_timer.Elapsed += nq_timer_Elapsed; nq_timer.Enabled = true; }
public NickServIdentifyRequest(string nick, IrcBot bot) { this.bot = bot; this.nick = nick; bot.RfcWhois(nick); bot.OnRawMessage += BotOnRawMessage; }
public AutoSighYawn(IrcBot b) { Bot = b; SecondsPassed = 0; SYTimer = new Timer(60000); SYTimer.Elapsed += SYTimer_Elapsed; SYTimer.Enabled = true; }
public static void onUserJoin(string name) { if (!isUserThere(name)) { list.Add(new User(name)); IrcBot.writeLine("[" + list.Count + "] " + name + " has joined", ConsoleColor.White); } }
public NickServIdentify(IrcBot bot) : base(bot) { bot.OnPart += BotOnPart; bot.OnKick += BotOnKick; bot.OnQuit += BotOnQuit; bot.OnNickChange += BotOnNickChange; }
static void Main(string[] args) { Console.OutputEncoding = Encoding.UTF8; Random random = new Random((int)DateTime.Now.Ticks & 0x0000FFFF); AIBConfiguration config = new AIBConfiguration("config.ini"); IrcBot bot = new IrcBot(config, random); bot.Connect(); bot.Run(); }
// ---------------- Functions ---------------- /// <summary> /// Loads the IRC config from the chaskis root. /// </summary> /// <param name="xmlFilePath">The path to the IRC config XML.</param> public void InitState1_LoadIrcConfig() { string ircConfigFile = Path.Combine(this.chaskisRoot, "IrcConfig.xml"); StaticLogger.Log.WriteLine("Using IRC config file '{0}'", ircConfigFile); this.ircConfig = XmlLoader.ParseIrcConfig(ircConfigFile); this.ircBot = new IrcBot(this.ircConfig, this.parsingQueue); }
internal PokerGame(IrcBot bot, string channel) { players = new Queue <PokerPlayer>(); State = GameState.CleanBoard; deck = new RandomDeck(); run = false; this.bot = bot; this.channel = channel; }
public BotConfigure(IrcBot botInstance) { bot = botInstance; bot.AddCommand(new Commandlet("!options", "The command !options lists all options you can set in the bot", this.GetList, this, CommandScope.Both, "engine_list_option")); bot.AddCommand(new Commandlet("!set", "The command !set <option> <value> sets the different options in the bot", this.SetOption, this, CommandScope.Both, "engine_set_option")); bot.AddCommand(new Commandlet("!get", "The command !get <option> shows the set value in the bot", this.GetOption, this, CommandScope.Both, "engine_get_option")); options = new Dictionary<string, BotOption>(); }
public void doResponse(Dictionary <String, AbstractManager> managers, Input input) { responses = new List <String>(); this.managers = managers; respond(input); foreach (String response in responses) { ((IrcConnectionManager)IrcBot.getManager(IrcConnectionManager.MANAGER_NAME)).connection.replyTo(input, response); } }
public BotConfigure(IrcBot botInstance) { bot = botInstance; bot.AddCommand(new Commandlet("!options", "The command !options lists all options you can set in the bot", this.GetList, this, CommandScope.Both, "engine_list_option")); bot.AddCommand(new Commandlet("!set", "The command !set <option> <value> sets the different options in the bot", this.SetOption, this, CommandScope.Both, "engine_set_option")); bot.AddCommand(new Commandlet("!get", "The command !get <option> shows the set value in the bot", this.GetOption, this, CommandScope.Both, "engine_get_option")); options = new Dictionary <string, BotOption>(); }
private void SendReplies(IEnumerable <String> replies, IrcBot server, string user, object source) { if (replies != null) { foreach (var reply in replies) { SendReply(reply, server, user, source); } } }
public override void Initialize(IrcBot ircBot, XmlNode pluginSettings) { Bot = ircBot; PluginSettings = pluginSettings; new LoadQuestionsCommand(this).Execute(); PercentageToBeCorrect = GetPercentCorrectness(); foreach (var channel in Bot.Settings.Channels) Games.Add(channel, new TriviaGame(this,channel)); }
public CuckHunt(IrcClient client, IrcBot bot) { _client = client; _ircBot = bot; ReloadConfig(); CommandPrefix = _ircBot.Command.CommandPrefix; foreach (string channel in _config.Channels) { CreateThread(channel); } }
public List <string> OnChannelMessage(IrcBot ircBot, string server, string channel, IrcMessage m) { if (m.Text.Contains("(╯°□°)╯︵ ┻━┻")) { return new List <string> { "┬──┬◡ノ(° -°ノ)" } } ; return(null); }
public List <string> IrcCommand(IrcBot ircBot, string server, IrcMessage m) { var text = m.Text.Trim(); var messageParts = text.Split(' '); var searchString = string.Join(" ", messageParts.Skip(1)); var searchResult = SearchHearthHead(searchString); return(new List <string> { searchResult }); }
// Gives the payout at each intervals public void Pay() { while (true) { Thread.Sleep(IrcBot.currencyInterval * 60000); foreach (User us in Users.list) { us.currency += IrcBot.currencyPayout; } IrcBot.writeLine("Payout !! +" + IrcBot.currencyPayout + " to everyone", ConsoleColor.White); IrcBot.Send("PRIVMSG " + IrcBot.CHANNEL + " :/me +" + IrcBot.currencyPayout + " " + IrcBot.oneCurrency + " for everyone!"); } }
public List <string> OnChannelMessage(IrcBot ircBot, string server, string channel, IrcMessage m) { var MatchUrlRegex = @"(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'"".,<>?«»“”‘’]))"; var results = Regex.Matches(m.Text, MatchUrlRegex); foreach (var result in results) { var r = result; OutputUrlTitle(r.ToString(), ircBot, channel); } return(null); }
public List <string> OnChannelMessage(IrcBot ircBot, string server, string channel, IrcMessage m) { var id = channel + m.Sender; var line = m.Text.Trim(); var expresion = @"\A[sr][/\\\\](.+?)[/\\\\](.*)(?:[/\\\\])?"; if (Regex.IsMatch(line, expresion)) { var match = Regex.Match(line, expresion); var original = match.Groups[1].Value; var replacement = match.Groups[2].Value; var rLastCharIndex = replacement.Length - 1; if (replacement[rLastCharIndex] == '\\' || replacement[rLastCharIndex] == '/') { replacement = replacement.Substring(0, rLastCharIndex); } if (_history[id].HasMatch(original)) { var text = _history[id].GetLine(original); return(new List <string> { string.Format("{0} Meant: {1}", m.Sender, ReplaceText(text, original, replacement)) }); } if (_generalHistory.HasMatch(original)) { var text = _generalHistory.GetLine(original); return(new List <string> { string.Format("{0} Thinks you meant: {1}", m.Sender, ReplaceText(text, original, replacement)) }); } return(null); } else if (!_history.ContainsKey(id)) { _history.Add(id, new LineHistory(5)); } _generalHistory.AddLine(line); _history[id].AddLine(line); return(null); }
public BotPluginManager(IrcBot bot, string relPluginPath) { this.bot = bot; this.bot.AddCommand(new Commandlet("!reload", "!reload unloads and reloads all the plugins", ReloadPlugins, this, CommandScope.Both, "pluginmanager_reload")); eventTimer = new Timer { Enabled = true, Interval = AbstractPlugin.MinTickIntervall * 1000 }; eventTimer.Elapsed += EventTick; pluginManager = new PluginManager(relPluginPath); pluginManager.PluginsReloaded += PluginsPluginsReloaded; pluginManager.IgnoreErrors = false; pluginManager.PluginSources = PluginSourceEnum.Both; pluginManager.AddReference(Assembly.GetEntryAssembly().Location); }
// Send PING to irc server every minutes public void Run() { while (true) { foreach (User us in Users.list) { us.watchTime++; XmlProcess.Write("xml\\users.xml", "User", us.name, us.admin.ToString(), us.currency.ToString(), us.watchTime.ToString(), us.hp.ToString(), us.def.ToString(), us.atk.ToString(), us.rep.ToString()); } IrcBot.Send(PING + IrcBot.SERVER); Thread.Sleep(60000); } }
public static void onUserLeft(string userName) { if (isUserThere(userName)) { foreach (User us in list) { if (us.name == userName && list.Contains(us)) { list.Remove(us); IrcBot.writeLine("[" + list.Count + "] " + us.name + " has left", ConsoleColor.White); break; } } } }
public TallyAction(IrcBot botMethods, VotingClient client, CertificateStorage certificateStorage, IrcEventArgs eventArgs) : base(botMethods, client, certificateStorage, eventArgs) { if (eventArgs.Data.MessageArray.Length == 2) { int votingNumberTemp; if (int.TryParse(eventArgs.Data.MessageArray[1], out votingNumberTemp)) { if (votingNumberTemp >= 0) { votingNumber = votingNumberTemp; } } } }
static void Main(string[] args) { IrcBot ircBot; ircBot = new IrcBot( server: "irc.freenode.net", port: 6667, user: "******", nick: "GadalkaLola", channel: "##net1337", maxRetries: 10 ); new Thread(() => ircBot.ReadFromChannel()).Start(); new Thread(() => ircBot.WriteToChannel()).Start(); }
public override void Initialize(IrcBot ircBot, XmlNode pluginSettings) { StreamWriters = new Dictionary<string, StreamWriter>(StringComparer.CurrentCultureIgnoreCase); _IrcBot = ircBot; Settings = GetSettings(pluginSettings); _Extension = Settings.ContainsKey(LogFileExtensionName) ? Settings[LogFileExtensionName] : "log"; if(string.IsNullOrEmpty(Settings[LogPathSettingName])) throw new Exception(@"No LogPath defined in settings file. Put this under <Logging>: <Set name=""LogPath"" value=""C:\Logs\""/>"); _LogPath = Settings[LogPathSettingName]; FlushInterval = Convert.ToDouble(Settings[AutoFlushSetting]); if(!Directory.Exists(_LogPath)) Directory.CreateDirectory(_LogPath); TurnOnLogging(); }
public void Register(IrcBot client) { Configure(); if (Directory.Exists(FileDirectory)) { _bot = client; FileSystemWatcher watcher = new FileSystemWatcher(); watcher.Path = FileDirectory; watcher.Filter = FileName; watcher.NotifyFilter = NotifyFilters.FileName; watcher.Renamed += watcher_Renamed; watcher.EnableRaisingEvents = true; } else { // log something eventually } }
public override void Initialize(IrcBot ircBot, XmlNode pluginSettings) { IrcBot = ircBot; Repository = new TaskListRepository(ircBot.Settings.Channels.ToArray(),IrcBot.FilePath); }
public StatusCommand( Pug currentPug, IrcBot bot ) : base(currentPug, bot) { b_command = new Regex( @"^status", RegexOptions.Compiled | RegexOptions.IgnoreCase ); }
public void Register(IrcBot bot) { _bot = bot; Configure(); EmailMonitor.EmailReceived += ProcessEmail; }
public HelpCommand(IrcBot bot) { Bot = bot; EligibleReceiveTypes = new List<ReceiveType> {ReceiveType.QueryMessage}; FirstMatchingWord = new List<string> {HelpKeyword, "?"}; }
public RemoveCommand( Pug currentPug, IrcBot bot ) : base(currentPug, bot) { }
public PartCommand(IrcBot bot) { Bot = bot; FirstMatchingWord = new List<string> {"leave", "part"}; EligibleReceiveTypes = new List<ReceiveType> {ReceiveType.QueryMessage}; }
public TestCommand( Pug currentPug, IrcBot bot ) : base(currentPug, bot) { b_command = new Regex( @"^test", RegexOptions.Compiled | RegexOptions.IgnoreCase ); }
public SharedClientSide(IrcBot botInstance) { serverSide = new SharedServerSide(botInstance); serverSide.OnAdmin += HandleOnAdmin; serverSide.OnAutoConnectError += HandleOnAutoConnectError; serverSide.OnAway += HandleOnAway; serverSide.OnBan += HandleOnBan; serverSide.OnChannelAction += HandleOnChannelAction; serverSide.OnChannelActiveSynced += HandleOnChannelActiveSynced; serverSide.OnChannelMessage += HandleOnChannelMessage; serverSide.OnChannelModeChange += HandleOnChannelModeChange; serverSide.OnChannelNotice += HandleOnChannelNotice; serverSide.OnChannelPassiveSynced += HandleOnChannelPassiveSynced; serverSide.OnConnected += HandleOnConnected; serverSide.OnConnecting += HandleOnConnecting; serverSide.OnConnectionError += HandleOnConnectionError; serverSide.OnCtcpReply += HandleOnCtcpReply; serverSide.OnCtcpRequest += HandleOnCtcpRequest; serverSide.OnDccChatReceiveLineEvent += HandleOnDccChatReceiveLineEvent; serverSide.OnDccChatRequestEvent += HandleOnDccChatRequestEvent; serverSide.OnDccChatSentLineEvent += HandleOnDccChatSentLineEvent; serverSide.OnDccChatStartEvent += HandleOnDccChatStartEvent; serverSide.OnDccChatStopEvent += HandleOnDccChatStopEvent; serverSide.OnDccSendReceiveBlockEvent += HandleOnDccSendReceiveBlockEvent; serverSide.OnDccSendRequestEvent += HandleOnDccSendRequestEvent; serverSide.OnDccSendSentBlockEvent += HandleOnDccSendSentBlockEvent; serverSide.OnDccSendStartEvent += HandleOnDccSendStartEvent; serverSide.OnDccSendStopEvent += HandleOnDccSendStopEvent; serverSide.OnDeadmin += HandleOnDeadmin; serverSide.OnDehalfop += HandleOnDehalfop; serverSide.OnDeop += HandleOnDeop; serverSide.OnDeowner += HandleOnDeowner; serverSide.OnDevoice += HandleOnDevoice; serverSide.OnDisconnected += HandleOnDisconnected; serverSide.OnDisconnecting += HandleOnDisconnecting; serverSide.OnError += HandleOnError; serverSide.OnErrorMessage += HandleOnErrorMessage; serverSide.OnHalfop += HandleOnHalfop; serverSide.OnInvite += HandleOnInvite; serverSide.OnJoin += HandleOnJoin; serverSide.OnKick += HandleOnKick; serverSide.OnList += HandleOnList; serverSide.OnModeChange += HandleOnModeChange; serverSide.OnMotd += HandleOnMotd; serverSide.OnNames += HandleOnNames; serverSide.OnNickChange += HandleOnNickChange; serverSide.OnNowAway += HandleOnNowAway; serverSide.OnOp += HandleOnOp; serverSide.OnOwner += HandleOnOwner; serverSide.OnPart += HandleOnPart; serverSide.OnPing += HandleOnPing; serverSide.OnPong += HandleOnPong; serverSide.OnQueryAction += HandleOnQueryAction; serverSide.OnQueryMessage += HandleOnQueryMessage; serverSide.OnQueryNotice += HandleOnQueryNotice; serverSide.OnQuit += HandleOnQuit; serverSide.OnRawMessage += HandleOnRawMessage; serverSide.OnReadLine += HandleOnReadLine; serverSide.OnRegistered += HandleOnRegistered; serverSide.OnTopic += HandleOnTopic; serverSide.OnTopicChange += HandleOnTopicChange; serverSide.OnUnAway += HandleOnUnAway; serverSide.OnUnban += HandleOnUnban; serverSide.OnUserModeChange += HandleOnUserModeChange; serverSide.OnVoice += HandleOnVoice; serverSide.OnWho += HandleOnWho; serverSide.OnWriteLine += HandleOnWriteLine; serverSide.SupportNonRfcChanged += HandleSupportNonRfcChanged; }
public AdminListCommand(IrcBot bot) { Bot = bot; FirstMatchingWord = new List<string> {"listadmins", "adminlist"}; }
public void processHeader() { IrcBot bot = new IrcBot(); Information info = new Information(); try { string[] httpInput = Regex.Split(inputLine, httpRegex.ToString(), RegexOptions.IgnoreCase); string[] input = info.msg().Split(' '); foreach (string text in input) if (Regex.IsMatch(text, httpRegex.ToString())) { WebClient web = new WebClient(); byte[] bInHttpStream = web.DownloadData(text); string inHttpString = Encoding.Default.GetString(bInHttpStream).Trim(); string[] data1 = Regex.Split(inHttpString.Trim(), "<title>|<TITLE>"); string[] titleContent = Regex.Split(data1[1].Trim(), "</title>|</TITLE>"); ChannelActions chanAct = new ChannelActions(); chanAct.say("[" + titleContent[0].Replace('\n',' ') + "]"); } } catch (Exception e) { Console.WriteLine(e.ToString()); } }
public void setMode(string mode, string target) { IrcBot bot = new IrcBot(); IrcBot.writer.WriteLine("MODE {0} {1} {2}", channel, mode, target); writer.Flush(); }
public Message353(IrcBot b) { Bot = b; }
public AddCommand( Pug currentPug, IrcBot bot ) : base(currentPug, bot) { }
public TopicCommand( TF2Pug.Pug currentPug, IrcBot bot ) : base(currentPug, bot) { b_command = new Regex( @"^topic .*", RegexOptions.Compiled | RegexOptions.IgnoreCase ); }
public Message376(IrcBot b) { Bot = b; }