public Bot(string host, string nickname, string canal) { irc = new TcpClient(host, 6667); // Realizamos la conexion con el canal usando el host y el puerto 6667 conexion = irc.GetStream(); // Cargamos la conexion para poder leer los datos leer_datos = new StreamReader(conexion); // Lo necesario para leer los datos de la conexion mandar_datos = new StreamWriter(conexion) { NewLine = "\r\n", AutoFlush = true }; // Lo necesario para mandar comandos al canal IRC commDao = CommsDAO.PrepareDBConnection(); this.host = host; this.nickname = nickname; this.canal = canal; }
public static void SingleStance() { try { Console.OutputEncoding = System.Text.Encoding.UTF8; if (CommsDAO.PrepareLoadChat()) { bot = RunBOT(); if (bot != null) { bot.WorkingBot(); } } } catch (Exception ex) { Console.WriteLine("Error Due To: " + ex.Message); Console.ReadLine(); } }