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(); } }
public static void Main() { using (var bot = new BotClient(configuration => BuildConfiguration())) bot.StartAsync().ContinueWith(task => Task.Delay(-1).Wait()).Wait(); }