예제 #1
0
        private static async Task <int> Main(string[] args)
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("settings.json", false, true)
                         .AddJsonFile("settings.dev.json", true, true)
                         .AddEnvironmentVariables("SHUSH_")
                         .Build();

            var settings = new SlackBotSettings();

            config.Bind(settings);

            try
            {
                var bot = new SlackBot(settings);
                await bot.Run();
            }
            catch (ShushBotException botException)
            {
                Console.WriteLine(botException.Message);
                return(1);
            }

            return(0);
        }
예제 #2
0
 /// <summary>
 /// Creates a new slack bot based on supplied settings. Does not connect to slack yet.
 /// </summary>
 public SlackBot(SlackBotSettings settings)
 {
     this.settings = settings;
 }