Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            IRCClientConsole client = new IRCClientConsole();
            client.StartInputThread();

            ShareXIRCSettings settings = null;

            try
            {
                do
                {
                    RestartRequested = false;

                    settings = SettingsBase.Load<ShareXIRCSettings>("Settings.json");
                    IRCBot bot = new IRCBot(client, settings);
                    bot.Start();
                }
                while (RestartRequested);
            }
            finally
            {
                if (settings != null)
                {
                    settings.Save();
                }
            }
        }
Exemplo n.º 2
0
        public IRCBot(IRCClientConsole client, ShareXIRCSettings settings)
        {
            Client = client;
            Settings = settings;

            Client.Init(Settings);
            IRC = client.IRC;
            IRC.Message += IRC_Message;
        }
Exemplo n.º 3
0
        public IRCBot(IRCClientConsole client)
        {
            Client = client;
            IRC = client.IRC;
            Info = client.Info;

            IRC.Message += irc_Message;
            IRC.WhoisResult += irc_WhoisResult;
            IRC.UserJoined += irc_UserJoined;
        }
Exemplo n.º 4
0
        private static void Main(string[] args)
        {
            IRCSettings settings = SettingsBase.Load<IRCSettings>("Settings.json");

            try
            {
                IRCClientConsole client = new IRCClientConsole(settings);
                client.Start();
            }
            finally
            {
                settings.Save();
            }
        }
Exemplo n.º 5
0
        private static void Main(string[] args)
        {
            IRCInfo info;

            if (File.Exists(DefaultSettingsPath))
            {
                info = Settings.Load<IRCInfo>(DefaultSettingsPath);
            }
            else
            {
                info = new IRCInfo();
            }

            IRCClientConsole client = new IRCClientConsole(info);
            IRCBot bot = new IRCBot(client);
            bot.Start();

            Settings.Save(info, DefaultSettingsPath);
        }