Exemple #1
0
        static void Main(string[] args)
        {
            var mkbot = new MonikaBot();

            mkbot.MainAsync().GetAwaiter().GetResult(); // Just let it run in background

            while (!mkbot.IsReady)
            {
                // Wait for bot to be ready
            }

            AdminConsole admin = new AdminConsole();

            admin.Client    = mkbot.Client;
            admin.Generator = mkbot.Generator;
            admin.Manager   = mkbot.Manager;

            Console.Write("> ");
            var cmd = Console.ReadLine();

            while (cmd != "exit")
            {
                admin.ParseCommand(cmd);
                Console.Write("> ");
                cmd = Console.ReadLine();
            }
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            // Generate reversion pdo

            /*
             * var chr = new Character();
             * chr.Name = "Sayori";
             * chr.Avatar = "Data\\Sayori\\25.png";
             * chr.Personality = "Data\\Sayori\\edgy.pdo";
             * chr.Responses = new List<string>();
             * chr.PdoFiles = new Dictionary<string, string>();
             * chr.PdoFiles.Add("default", "Data\\Sayori\\edgy.pdo");
             * chr.Emotions = new Dictionary<string, string>();
             * chr.Emotions.Add("default", "Data\\Sayori\\25.png");
             * var chr_json = JsonConvert.SerializeObject(chr, Formatting.Indented);
             * File.WriteAllText("sayoritest.pdo", chr_json);
             */

            var mkbot = new MonikaBot();

            mkbot.MainAsync().GetAwaiter().GetResult(); // Just let it run in background

            // I really hate doing this because it'll block main() entirely while the bot boots up in the background
            // There's alternative ways but I don't want to have to go back and forth between event handlers, yk?
            // We can maybe implement that in a future update
            while (!mkbot.IsReady)
            {
                // Wait for bot to be ready
            }

            AdminConsole admin = new AdminConsole();

            admin.Client      = mkbot.Client;
            admin.Generator   = mkbot.Generator;
            admin.Personality = mkbot.Personality;

            Console.Write("> ");
            var cmd = Console.ReadLine();

            while (cmd != "exit")
            {
                admin.ParseCommand(cmd);
                Console.Write("> ");
                cmd = Console.ReadLine();
            }
        }