예제 #1
0
 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...");
 }
예제 #2
0
 private IContainer GetAutofacContainer(DiscordConfiguration configuration)
 {
     return(new ContainerModule(configuration)
            .GetBuilder()
            .Build());
 }