Exemple #1
0
        public ClientInterface(IrcLoginCreds loginCreds, List <IrcComponent> auxComponents)
        {
            KillClient                  = false;
            Client                      = new IrcClient();
            Client.SendDelay            = 200;
            Client.ActiveChannelSyncing = true;
            //Client.AutoRetry = true;
            _loginCreds        = loginCreds;
            Client.CtcpVersion = "Pikatwo - Interactive chatbot with lifelike texture by zalzane.";

            _authenticator = new Authenticator();

            _components = auxComponents;
            _components.Add(_authenticator);
            _components.Add(new Reconnector());

            foreach (var component in _components)
            {
                component.IrcInterface = this;
            }

            Client.OnChannelMessage += HandleCommands;
            Client.OnQueryMessage   += HandleCommands;
            Client.OnRawMessage     += ClientOnOnRawMessage;

            _debugWriter = new StreamWriter("debugOut.txt", true);
            _rawWriter   = new StreamWriter("rawOut.txt", true);
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            var sr     = new StreamReader(_configFile);
            var config = JObject.Parse(sr.ReadToEnd());

            var creds = new IrcLoginCreds();

            creds.Nick     = config["Nick"].ToObject <string>();
            creds.Password = config["Password"].ToObject <string>();
            creds.Port     = config["Port"].ToObject <int>();
            creds.Server   = config["Server"].ToObject <string>();
            creds.RealName = config["RealName"].ToObject <string>();
            creds.UserName = config["UserName"].ToObject <string>();

            var components = new List <IrcComponent>();
            var channels   = config["Channels"].ToObject <string[]>();

            components.Add(new ChannelManage(channels));
            components.Add(new Responder(creds.Nick));
            components.Add(new GithubTracker());
            //components.Add(new Encryptor());
            components.Add(new Ticker());
            //components.Add(new HappyNewYear());

            var client = new ClientInterface(creds, components);

            client.Run();
        }
        public ClientInterface(IrcLoginCreds loginCreds, List<IrcComponent> auxComponents)
        {
            KillClient = false;
            Client = new IrcClient();
            Client.SendDelay = 200;
            Client.ActiveChannelSyncing = true;
            //Client.AutoRetry = true;
            _loginCreds = loginCreds;
            Client.CtcpVersion = "Pikatwo - Interactive chatbot with lifelike texture by zalzane.";

            _authenticator = new Authenticator();

            _components = auxComponents;
            _components.Add(_authenticator);
            _components.Add(new Reconnector());

            foreach (var component in _components){
                component.IrcInterface = this;
            }

            Client.OnChannelMessage += HandleCommands;
            Client.OnQueryMessage += HandleCommands;
            Client.OnRawMessage += ClientOnOnRawMessage;

            _debugWriter = new StreamWriter("debugOut.txt", true);
            _rawWriter = new StreamWriter("rawOut.txt", true);
        }
Exemple #4
0
        public static void Main(string[] args)
        {
            var sr = new StreamReader(_configFile);
            var config = JObject.Parse(sr.ReadToEnd());

            var creds = new IrcLoginCreds();
            creds.Nick = config["Nick"].ToObject<string>();
            creds.Password = config["Password"].ToObject<string>();
            creds.Port = config["Port"].ToObject<int>();
            creds.Server = config["Server"].ToObject<string>();
            creds.RealName = config["RealName"].ToObject<string>();
            creds.UserName = config["UserName"].ToObject<string>();

            var components = new List<IrcComponent>();
            var channels = config["Channels"].ToObject<string[]>();
            components.Add(new ChannelManage(channels));
            components.Add(new Responder(creds.Nick));
            components.Add(new GithubTracker());
            //components.Add(new Encryptor());
            components.Add(new Ticker());
            //components.Add(new HappyNewYear());

            var client = new ClientInterface(creds, components);
            client.Run();
        }