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(); } } }
public IRCBot(IRCClientConsole client, ShareXIRCSettings settings) { Client = client; Settings = settings; Client.Init(Settings); IRC = client.IRC; IRC.Message += IRC_Message; }
public IRCBot(IRCClientConsole client) { Client = client; IRC = client.IRC; Info = client.Info; IRC.Message += irc_Message; IRC.WhoisResult += irc_WhoisResult; IRC.UserJoined += irc_UserJoined; }
private static void Main(string[] args) { IRCSettings settings = SettingsBase.Load<IRCSettings>("Settings.json"); try { IRCClientConsole client = new IRCClientConsole(settings); client.Start(); } finally { settings.Save(); } }
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); }