예제 #1
0
 public MusicHandler(LavaRestClient lavaRestClient, LavaSocketClient lavaSocketClient, DiscordSocketClient client, IDiscordLogger logger)
 {
     _lavaRestClient   = lavaRestClient ?? throw new ArgumentNullException(nameof(lavaRestClient));
     _lavaSocketClient = lavaSocketClient ?? throw new ArgumentNullException(nameof(lavaSocketClient));
     _client           = client ?? throw new ArgumentNullException(nameof(client));
     _logger           = logger ?? throw new ArgumentNullException(nameof(logger));
 }
예제 #2
0
        public StatsManager(HttpClient httpClient)
        {
            _httpClient = httpClient;
            _logger     = DicordLogFactory.GetLogger <StatsManager>(GlobalVariables.DiscordId, GlobalVariables.DiscordToken);

            WebHookClient.RateLimitMs = 1000;
        }
예제 #3
0
 public Connection(DiscordSocketClient client, ICommandHandler handler, IDiscordLogger logger, IRepeater repeater)
 {
     _client   = client ?? throw new ArgumentNullException(nameof(client));
     _handler  = handler ?? throw new ArgumentNullException(nameof(handler));
     _logger   = logger ?? throw new ArgumentNullException(nameof(logger));
     _repeater = repeater ?? throw new ArgumentNullException(nameof(repeater));
 }
예제 #4
0
        public StartupService(IConfigurationRoot config, IStellarService stellarService)
        {
            //DatabaseQueueService databaseQueueService
            _config         = config;
            _stellarService = stellarService;

            _logger = DicordLogFactory.GetLogger <StartupService>(GlobalVariables.DiscordId, GlobalVariables.DiscordToken);
        }
예제 #5
0
        static Startup()
        {
            ILoggerRepository logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

            XmlConfigurator.Configure(logRepository, new FileInfo("Kin.Horizon.Api.Poller.dll.config"));

            Logger = DicordLogFactory.GetLogger <Startup>(GlobalVariables.DiscordId, GlobalVariables.DiscordToken);
        }
예제 #6
0
 public CommandHandler(DiscordSocketClient client, CommandService service, IDiscordLogger logger, IServiceProvider provider, IPointsService points, IGuildHandler guild)
 {
     _client   = client ?? throw new ArgumentNullException(nameof(client));
     _service  = service ?? throw new ArgumentNullException(nameof(service));
     _logger   = logger ?? throw new ArgumentNullException(nameof(logger));
     _provider = provider ?? throw new ArgumentNullException(nameof(provider));
     _points   = points ?? throw new ArgumentNullException(nameof(points));
     _guild    = guild ?? throw new ArgumentNullException(nameof(guild));
     _service.AddModulesAsync(typeof(HelpService).Assembly, provider);
 }
예제 #7
0
 public Connection(DiscordShardedClient client, IDiscordLogger discordLogger, ILogger logger, ICommandHandler commandHandler, IExpHandler expHandler, EventMessageHandler eventMsgHandler, IUserLeftHandler userLeftHandler)
 {
     _client          = client;
     _discordLogger   = discordLogger;
     _logger          = logger;
     _commandHandler  = commandHandler;
     _expHandler      = expHandler;
     _eventMsgHandler = eventMsgHandler;
     _userLeftHandler = userLeftHandler;
 }
예제 #8
0
 public BotStartup(IDiscordLogger genericDiscordDiscordLogger, ILogger <BotStartup> logger,
                   CommandService commandService, IServiceProvider serviceProvider,
                   IHostApplicationLifetime applicationLifetime, DiscordSocketClient client, GeneralOptions options)
 {
     _discordLogger       = genericDiscordDiscordLogger;
     _logger              = logger;
     _commandService      = commandService;
     _serviceProvider     = serviceProvider;
     _applicationLifetime = applicationLifetime;
     _client              = client;
     _options             = options;
 }
예제 #9
0
        public StellarService(IConfigurationRoot config, HttpClient httpClient, StatsManager statsManager)
        {
            _statsManager   = statsManager;
            _config         = config;
            _queueNotifier1 = new AutoResetEvent(false);
            _httpClient     = httpClient;

            _logger = DicordLogFactory.GetLogger <StellarService>(GlobalVariables.DiscordId, GlobalVariables.DiscordToken);
            _operationsToHandleQueue = new ConcurrentQueue <OperationResponse>();
            ServicePointManager.DefaultConnectionLimit = 100;
            _logger.LogInformation($"Stellar service is using endpoint {_config["StellarService:HorizonHostname"]}");
            _server = new Server(_config["StellarService:HorizonHostname"]);
            Network.UsePublicNetwork();

            _startTime = new Stopwatch();
            var queueThread = new Task(HandleResponseQueue, TaskCreationOptions.LongRunning);

            queueThread.Start();

            _timer          = new System.Timers.Timer(50);
            _timer.Elapsed += Timer_tick;
            _timer.Enabled  = true;
            _timer.Start();
        }
예제 #10
0
 public DiscordConnection(IClientManager clientManager, ICommandHandler commandHandler, IDiscordLogger discordLogger)
 {
     this.clientManager  = clientManager;
     this.commandHandler = commandHandler;
     this.discordLogger  = discordLogger;
 }