コード例 #1
0
        public static void Main(string[] args)
        {
            if (!File.Exists("settings.json"))
            {
                Console.WriteLine("No settings.json file found.");
                return;
            }

            Configuration configObject;

            try
            {
                configObject = Configuration.LoadConfiguration("settings.json");
            }
            catch (Newtonsoft.Json.JsonReaderException)
            {
                // handle basic json formatting screwups
                Console.WriteLine("settings.json file is currupt or improperly formatted.");
                return;
            }

            if (configObject.Bots.Length > 0)
            {
                //Bot b = new Bot(configObject.Bots[botIndex], configObject.ApiKey, BotManager.UserHandlerCreator, true);
                BotControlForm frm = new BotControlForm(configObject.Bots[0], configObject.ApiKey, true);
                frm.ShowDialog();
                Application.Exit();

                //frm.StartBot();
                //Console.Title = configObject.Bots[botIndex].DisplayName;
                //b.StartBot(); // never returns from this.
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: KimimaroTsukimiya/PonyBot
        public static void Main(string[] args)
        {

            if (!File.Exists("settings.json"))
            {
                Console.WriteLine("No settings.json file found.");
                return;
            }

            Configuration configObject;
            try
            {
                configObject = Configuration.LoadConfiguration("settings.json");
            }
            catch (Newtonsoft.Json.JsonReaderException)
            {
                // handle basic json formatting screwups
                Console.WriteLine("settings.json file is currupt or improperly formatted.");
                return;
            }

            if (configObject.Bots.Length > 0)
            {
                //Bot b = new Bot(configObject.Bots[botIndex], configObject.ApiKey, BotManager.UserHandlerCreator, true);
                BotControlForm frm = new BotControlForm(configObject.Bots[0], configObject.ApiKey, true);
                frm.ShowDialog();
                Application.Exit();
                
                //frm.StartBot();
                //Console.Title = configObject.Bots[botIndex].DisplayName;
                //b.StartBot(); // never returns from this.
            }
        }