Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new bot instance using the provided builder.
        /// </summary>
        /// <param name="builder">The builder.</param>
        /// <returns>New Bot instance.</returns>
        public static Bot Create(IBuilder builder)
        {
            try
            {
                builder.RegisterComponents();
                builder.LoadModuleComponents();

                return builder.Build<Bot>();
            }
            catch (Exception ex)
            {
                Exception e = new Exception("Error initializing required bot components. Unable to initialize bot.", ex);
                throw e;
            }
        }