public static async Task Main(string[] args) { #if DEBUG var configPath = "config.json"; #elif RELEASE var configPath = "config-prod.json"; #endif var configuration = JsonConvert.DeserializeObject <DiscordConfiguration>(File.ReadAllText(configPath)); var watchman = new WatchmanBot(configuration); await watchman.GetWorkflowBuilder().Run(); }
public static void Main(string[] args) { #if DEBUG var configPath = "config.json"; #elif RELEASE var configPath = "config-prod.json"; #endif var configuration = JsonConvert.DeserializeObject <DiscordConfiguration>(File.ReadAllText(configPath)); var watchman = new WatchmanBot(configuration); var workflowBuilder = watchman.GetWorkflowBuilder(); workflowBuilder.Build(); Thread.Sleep(Timeout.Infinite); }
public static async Task Main(string[] args) { #if DEBUG var configPath = "config.json"; #elif RELEASE var configPath = "config-prod.json"; #endif var configuration = JsonConvert.DeserializeObject <DiscordConfiguration>(File.ReadAllText(configPath)); var watchman = new WatchmanBot(configuration); var workflowBuilder = watchman.GetWorkflowBuilder(); AppDomain.CurrentDomain.UnhandledException += (sender, e) => { HandleException((Exception)e.ExceptionObject); }; while (true) { await TryToRun(workflowBuilder); } }