示例#1
0
文件: Program.cs 项目: Trapov/Simpbot
 public static void Main(string[] args)
 {
     if (args.Contains(RegisterServiceFlag))
     {
         SimpbotServiceBuilder.RegisterService(RegisterServiceFlag, RunAsServiceFlag);
     }
     else if (args.Contains(RunAsServiceFlag))
     {
         using (var bot = new BotClient(configuration => BuildConfiguration(false)))
             SimpbotServiceBuilder.RunAsService(bot);
     }
     else
     {
         using (var bot = new BotClient(configuration => BuildConfiguration(true)))
             bot.StartAsync().GetAwaiter().GetResult();
     }
 }
示例#2
0
文件: Program.cs 项目: Voxed/Simpbot
 public static void Main()
 {
     using (var bot = new BotClient(configuration => BuildConfiguration())) bot.StartAsync().ContinueWith(task => Task.Delay(-1).Wait()).Wait();
 }