public Client() { SocketClient = new DiscordSocketClient(); _commands = new CommandService(); _services = new ServiceCollection() .AddSingleton(SocketClient) .AddSingleton(_commands) .BuildServiceProvider(); _backupHandler = new BackupHandler(); }
public Worker(ILogger <Worker> logger, IBackupHandler backupHandler, ICommonUtil commonUtil) { _logger = logger; _backupHandler = backupHandler; _commonUtil = commonUtil; var scheduleJson = System.IO.File.ReadAllText(System.IO.Path.Combine(_commonUtil.AppPath(), "schedulesettings.json")); _scheduleModel = JsonConvert.DeserializeObject <ScheduleModel>(scheduleJson); }