Exemplo n.º 1
0
 public Client()
 {
     SocketClient = new DiscordSocketClient();
     _commands    = new CommandService();
     _services    = new ServiceCollection()
                    .AddSingleton(SocketClient)
                    .AddSingleton(_commands)
                    .BuildServiceProvider();
     _backupHandler = new BackupHandler();
 }
Exemplo n.º 2
0
        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);
        }