Esempio n. 1
0
 public GarupaEventHandler(GarupaData data, BestdoriClient client, ILogger <GarupaEventHandler> logger)
 {
     this.data     = data;
     this.client   = client;
     this.logger   = logger;
     latestEventId = -1;
 }
Esempio n. 2
0
 public GachaHandler(GarupaData data, BestdoriClient client, ILogger <GachaHandler> logger, GachaImageRender render)
 {
     this.data   = data;
     this.client = client;
     stars       = new Dictionary <int, string>()
     {
         { 1, "★1" },
         { 2, "★2" },
         { 3, "★3" },
         { 4, "★4" }
     };
     this.logger = logger;
     this.render = render;
 }
Esempio n. 3
0
        public Worker(ILogger <Worker> logger, MiraiHttpSession session,
                      IOptions <MiraiSessionOptions> miraiSessionOptions, GarupaData data,
                      IServiceProvider serviceProvider, BestdoriClient client)
        {
            _logger              = logger;
            _session             = session;
            _miraiSessionOptions = miraiSessionOptions;
            _client              = client;
            _data            = data;
            _serviceProvider = serviceProvider;
            _timer           = new System.Timers.Timer(TimeSpan.FromHours(1).TotalMilliseconds);
            var plugins = Assembly.GetExecutingAssembly().DefinedTypes.Where(ti => ti.GetInterface("ITimeMessageHandler") != null).ToArray();

            foreach (var plugin in plugins)
            {
                _handlers.Add((ITimeMessageHandler)serviceProvider.GetService(plugin.AsType()));
            }
        }