Example #1
0
        public void workRunMMDK()
        {
            try
            {
                logMMDK($"正在等待Mirai启动...");

                while (State != runState.mmdkInit)
                {
                    Thread.Sleep(500);
                    if (State == runState.exit)
                    {
                        // exit
                        logMMDK("退出bot");
                        return;
                    }
                }

                logMMDK($"Mirai启动完成,开始启动bot...");

                bot = new MainProcess();
                bot.processOutput += new processOutputHandler(logMMDK);
                bot.Init(config, miraiInfo);

                State = runState.ok;
                logMMDK($"bot启动完成,开始接受数据。");
            }
            catch (Exception ex)
            {
                logMMDK(ex.Message + "\r\n" + ex.StackTrace);
            }
        }