package jp.gecko655.fujimiya.bot;

import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;

import static org.quartz.JobBuilder.newJob;
import static org.quartz.SimpleScheduleBuilder.repeatSecondlyForever;
import static org.quartz.TriggerBuilder.newTrigger;

public class SchedulerMain {
    private static Scheduler scheduler;
    public static void main(String[] args) throws SchedulerException {
        System.out.println("Scheduler Started!!!");
        scheduler = StdSchedulerFactory.getDefaultScheduler();

        scheduler.start();
        setSchedule(FujimiyaReply.class, 60*5);
        //setSchedule(FujimiyaRemove.class, 60*5);

    }
    private static void setSchedule(Class<? extends Job> classForExecute, int intervalSeconds) throws SchedulerException {
        JobDetail jobDetail = newJob(classForExecute).build();

        Trigger trigger = newTrigger()
                .startNow()
                .withSchedule(repeatSecondlyForever(intervalSeconds))
                .build();

        scheduler.scheduleJob(jobDetail, trigger);
        System.out.println(classForExecute.getName()+" has been scheduled in interval: "+intervalSeconds+" [s]");
        
    }

}
@@ -28,16 +28,69 @@
 a.bot;%0A%0A
+import java.time.ZoneId;%0Aimport java.util.TimeZone;%0A%0A
 import o
@@ -638,21 +638,44 @@
 .class, 
+repeatSecondlyForever(
 60*5)
+)
 ;%0A      
@@ -680,48 +680,516 @@
     
-//setSchedule(FujimiyaRemove.class, 60*5
+setSchedule(FujimiyaBot.class, repeatSecondlyForever(60*60*4));%0A        setSchedule(%0A                FujimiyaLunch.class, %0A                CronScheduleBuilder%0A                    .dailyAtHourAndMinute(12, 25)%0A                    .inTimeZone(TimeZone.getTimeZone(%22JST%22)));%0A        setSchedule(%0A                FujimiyaRemove.class, %0A                CronScheduleBuilder%0A                    .atHourAndMinuteOnGivenDaysOfWeek(9, 0, DateBuilder.MONDAY)%0A                    .inTimeZone(TimeZone.getTimeZone(%22JST%22))
 );%0A%0A
@@ -1272,27 +1272,51 @@
 te, 
-int intervalSeconds
+ScheduleBuilder%3C? extends Trigger%3E schedule
 ) th
@@ -1506,46 +1506,16 @@
 ule(
-repeatSecondlyForever(intervalSeconds)
+schedule
 )%0A  
@@ -1667,45 +1667,8 @@
 uled
- in interval: %22+intervalSeconds+%22 %5Bs%5D
 %22);%0A

Set schedule for 4 crons.