Beispiel #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( );
        }
Beispiel #2
0
        public LiveEmbedService(IDiscordBotConfig config, ICommonResources resources)
        {
            Config    = config;
            Resources = resources;

            embeds  = ImmutableDictionary <int, IServerEmbedInfo> .Empty;
            subject = new Subject <IServerEmbedInfo> ( );
        }
Beispiel #3
0
        public ServerEmbedInfo(IDiscordBotConfig config,
                               ICommonResources resources,
                               int port,
                               string serverName)
        {
            Config     = config;
            Resources  = resources;
            Port       = port;
            ServerName = serverName;

            ConnectString = $"iw4x://{Config.ExternalIP}:{Port}";
        }
 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;
 }