示例#1
0
        public DiscordBotService(IDiscordBotConfig config,
                                 IServerMonitorService monitorService,
                                 IProcessWatcherService watcherService,
                                 ICommonResources resources)
        {
            Config         = config;
            MonitorService = monitorService;
            WatcherService = watcherService;
            Resources      = resources;

            client                  = new DiscordSocketClient( );
            client.Log             += Log;
            client.MessageReceived += MessageReceivedAsync;

            commands                  = new CommandService( );
            commands.Log             += Log;
            commands.CommandExecuted += CommandExecutedAsync;

            embedService                = new LiveEmbedService(Config, Resources);
            channelUpdaterService       = new ChannelUpdaterService(Config, embedService);
            personalNotificationService = new PersonalNotificationService(Config, embedService);

            var container = BuildContainer( );

            services = new AutofacServiceProvider(container);
            AddCommands( );
        }
 public ServerModule(
     IDiscordBotConfig config,
     IServerMonitorService monitorService,
     ILiveEmbedService embedService,
     IChannelUpdaterService channelUpdaterService,
     IPersonalNotificationService personalNotificationService,
     ICommonResources resources
     )
 {
     Config                      = config;
     MonitorService              = monitorService;
     EmbedService                = embedService;
     ChannelUpdaterService       = channelUpdaterService;
     PersonalNotificationService = personalNotificationService;
     Resources                   = resources;
 }