diff --git a/gradle.properties b/gradle.properties index f0b6faa..8e2dad1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ ## Core -VERSION = 0.6.0.2 +VERSION = 0.6.1.0 # dependencies diff --git a/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java b/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java index 1316cb7..1bcf519 100644 --- a/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java +++ b/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java @@ -4,6 +4,6 @@ package cc.sukazyo.cono.morny; * the final field that will be updated by gradle automatically. */ public class GradleProjectConfigures { - public static final String VERSION = "0.6.0.2"; - public static final long COMPILE_TIMESTAMP = 1647237887029L; + public static final String VERSION = "0.6.1.0"; + public static final long COMPILE_TIMESTAMP = 1647356707522L; } diff --git a/src/main/java/cc/sukazyo/cono/morny/bot/event/OnKuohuanhuanNeedSleep.java b/src/main/java/cc/sukazyo/cono/morny/bot/event/OnKuohuanhuanNeedSleep.java index 3c7101c..8863f75 100644 --- a/src/main/java/cc/sukazyo/cono/morny/bot/event/OnKuohuanhuanNeedSleep.java +++ b/src/main/java/cc/sukazyo/cono/morny/bot/event/OnKuohuanhuanNeedSleep.java @@ -14,11 +14,16 @@ public class OnKuohuanhuanNeedSleep extends EventListener { @Override public boolean onMessage (@Nonnull Update update) { + final GregorianCalendar time = new GregorianCalendar(Locale.TAIWAN); + time.setTimeInMillis(System.currentTimeMillis()); if ( - update.message().from().id() == 786563752L && ( - new GregorianCalendar(Locale.TAIWAN).get(Calendar.HOUR_OF_DAY) >= 23 || - new GregorianCalendar(Locale.TAIWAN).get(Calendar.HOUR_OF_DAY) < 5 - ) + ( update.message().from().id() == 786563752L && ( + time.get(Calendar.HOUR_OF_DAY) >= 23 || + time.get(Calendar.HOUR_OF_DAY) < 5 + )) || ( update.message().from().id() == 1075871712L && ( + (time.get(Calendar.HOUR_OF_DAY) >= 22 && time.get(Calendar.MINUTE) >= 30) || + time.get(Calendar.HOUR_OF_DAY) < 5 + )) ) { MornyCoeur.extra().exec( new DeleteMessage(update.message().chat().id(), diff --git a/src/main/java/cc/sukazyo/cono/morny/data/NbnhhshQuery.java b/src/main/java/cc/sukazyo/cono/morny/data/NbnhhshQuery.java index 90119aa..cd1be74 100644 --- a/src/main/java/cc/sukazyo/cono/morny/data/NbnhhshQuery.java +++ b/src/main/java/cc/sukazyo/cono/morny/data/NbnhhshQuery.java @@ -23,7 +23,7 @@ public class NbnhhshQuery { public Word[] words; } - public static record GuessReq (String text) { + public record GuessReq (String text) { } public static final String API_URL = "https://lab.magiconch.com/api/nbnhhsh/"; @@ -47,8 +47,4 @@ public class NbnhhshQuery { } } - public static void main(String[] args) { - System.out.println(new Gson().toJson(new GuessReq("8h28oey8 qe89 aoHO*)I'[ IK\"@+ )EOI)D\"{AIR\")Q @}"))); - } - } diff --git a/src/main/java/cc/sukazyo/cono/morny/util/TelegramUserInformation.java b/src/main/java/cc/sukazyo/cono/morny/util/TelegramUserInformation.java index 011e4da..1514d56 100644 --- a/src/main/java/cc/sukazyo/cono/morny/util/TelegramUserInformation.java +++ b/src/main/java/cc/sukazyo/cono/morny/util/TelegramUserInformation.java @@ -3,6 +3,7 @@ package cc.sukazyo.cono.morny.util; import com.pengrad.telegrambot.model.User; import static cc.sukazyo.untitled.util.telegram.formatting.MsgEscape.escapeHtml; + public class TelegramUserInformation { public static String informationOutputHTML (User user) {