Beispiel #1
0
        public LaunchNotificationsCommands(SubscriptionsService subscriptionsService, LaunchNotificationsService launchNotificationsService, LaunchNotificationEmbedBuilder launchNotificationEmbedBuilder)
        {
            _launchNotificationsService     = launchNotificationsService;
            _subscriptionsService           = subscriptionsService;
            _launchNotificationEmbedBuilder = launchNotificationEmbedBuilder;

            launchNotificationsService.OnLaunchNotification += LaunchNotificationsOnLaunchNotificationAsync;
        }
        public SingleLaunchCommands(OddityCore oddity, CacheService cacheService, LaunchNotificationsService launchNotificationsService, LaunchInfoEmbedGenerator launchInfoEmbedGenerator)
        {
            _oddity       = oddity;
            _cacheService = cacheService;
            _launchNotificationsService = launchNotificationsService;
            _launchInfoEmbedGenerator   = launchInfoEmbedGenerator;

            _cacheService.RegisterDataProvider(CacheContentType.AllLaunches, async p => await _oddity.LaunchesEndpoint.GetAll().ExecuteAsync());
            _cacheService.RegisterDataProvider(CacheContentType.NextLaunch, async p => await _oddity.LaunchesEndpoint.GetNext().ExecuteAsync());
            _cacheService.RegisterDataProvider(CacheContentType.LatestLaunch, async p => await _oddity.LaunchesEndpoint.GetLatest().ExecuteAsync());
        }