示例#1
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 public DiscordSocketClientWrapper(IDiscordBotConfig botConfig)
 {
     _botConfig                           = botConfig;
     DiscordSocketClient                  = new DiscordSocketClient();
     DiscordSocketClient.Log             += DiscordSocketClientOnLog;
     DiscordSocketClient.MessageReceived += DiscordSocketClientOnMessageReceived;
 }
示例#2
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( );
        }
示例#3
0
        public LiveEmbedService(IDiscordBotConfig config, ICommonResources resources)
        {
            Config    = config;
            Resources = resources;

            embeds  = ImmutableDictionary <int, IServerEmbedInfo> .Empty;
            subject = new Subject <IServerEmbedInfo> ( );
        }
        public PersonalNotificationService(IDiscordBotConfig config,
                                           ILiveEmbedService embedService)
        {
            Config       = config;
            EmbedService = embedService;

            users = ImmutableDictionary <ulong, IUser> .Empty;

            EmbedService.Subscribe(NotifyUsers);
        }
        public ChannelUpdaterService(IDiscordBotConfig config,
                                     ILiveEmbedService embedService)
        {
            Config       = config;
            EmbedService = embedService;

            messages            = ImmutableDictionary <int, IUserMessage> .Empty;
            nextMessageWaitTime = DateTime.Now;

            EmbedService.Subscribe(UpdateChannel);
        }
示例#6
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;
 }
 /// <summary>
 /// Default Constructor
 /// </summary>
 public SocketMessageWrapper(IDiscordBotConfig botConfig)
 {
     _botConfig = botConfig;
     _logger    = StaticLogger.GetLogger <SocketMessageWrapper>();
 }