Ejemplo n.º 1
0
        public ReminderService(IServiceProvider provider)
        {
            serviceProvider = provider;
            scheduler       = provider.GetRequiredService <SchedulerService>();
            client          = provider.GetRequiredService <DiscordSocketClient>();

            client.Ready += RescheduleExistingReminders;
        }
Ejemplo n.º 2
0
        public AlarmService(SchedulerService scheduler, DiscordSocketClient client, Random random, IConfigService config)
            : base(config)
        {
            this.client    = client;
            this.random    = random;
            this.scheduler = scheduler;

            ffmpegArguments = new FFmpegArguments().WithOutputFormat("s16le").WithPipedOutput();

            DateTime dateTime = DateTime.Parse("6:00am");

            scheduler.ScheduleRecurringTask(dateTime, "AlarmRescheduler", RescheduleAlarms);

            //Schedule the alarms in case bot is restarted mid school day
            RescheduleAlarms(null);
        }