Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
            }
        }