Beispiel #1
0
        public async Task InitializeAsync(IServiceProvider provider)
        {
            var sw = Stopwatch.StartNew();
            var l  = await _service.AddTypeParsersAsync();

            sw.Stop();
            _logger.Info(LogSource.Volte, $"Loaded TypeParsers: \"{l.Select(x => x.SanitizeParserName()).Join(", ")}\" in {sw.ElapsedMilliseconds}ms.");
            sw = Stopwatch.StartNew();

            var loaded = _service.AddModules(GetType().Assembly);

            sw.Stop();
            _logger.Info(LogSource.Volte,
                         $"Loaded {loaded.Count} modules and {loaded.Sum(m => m.Commands.Count)} commands loaded in {sw.ElapsedMilliseconds}ms.");
            await _client.RegisterVolteEventHandlersAsync(provider);
        }