public WatchmanBot(DiscordConfiguration configuration, IComponentContext context = null) { this._configuration = configuration; this._context = context ?? this.GetAutofacContainer(configuration).Resolve <IComponentContext>(); Log.Logger = SerilogInitializer.Initialize(this._context.Resolve <IMongoDatabase>()); Log.Information("Bot created..."); }
private IContainer GetAutofacContainer(DiscordConfiguration configuration) { return(new ContainerModule(configuration) .GetBuilder() .Build()); }