From b35b0600dc6112cae66b83ed7df7df853589a18a Mon Sep 17 00:00:00 2001 From: Eyre_S Date: Tue, 31 May 2022 11:41:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=83=E8=8D=AF=E6=8F=90=E9=86=92=E6=B6=88?= =?UTF-8?q?=E6=81=AF=20pin=20=E6=94=AF=E6=8C=81=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- .../java/cc/sukazyo/cono/morny/GradleProjectConfigures.java | 4 ++-- .../java/cc/sukazyo/cono/morny/daemon/MedicationTimer.java | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 1b57c05..ab4a9cd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ ## Core -VERSION = 0.7.0.14 +VERSION = 0.7.0.15 CODENAME = fuzhou diff --git a/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java b/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java index 48e6fba..f471d62 100644 --- a/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java +++ b/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java @@ -4,7 +4,7 @@ package cc.sukazyo.cono.morny; * the final field that will be updated by gradle automatically. */ public class GradleProjectConfigures { - public static final String VERSION = "0.7.0.14"; + public static final String VERSION = "0.7.0.15"; public static final String CODENAME = "fuzhou"; - public static final long COMPILE_TIMESTAMP = 1653924732379L; + public static final long COMPILE_TIMESTAMP = 1653968380239L; } diff --git a/src/main/java/cc/sukazyo/cono/morny/daemon/MedicationTimer.java b/src/main/java/cc/sukazyo/cono/morny/daemon/MedicationTimer.java index f081bf2..36d464a 100644 --- a/src/main/java/cc/sukazyo/cono/morny/daemon/MedicationTimer.java +++ b/src/main/java/cc/sukazyo/cono/morny/daemon/MedicationTimer.java @@ -2,7 +2,9 @@ package cc.sukazyo.cono.morny.daemon; import cc.sukazyo.cono.morny.MornyCoeur; import cc.sukazyo.cono.morny.data.TelegramStickers; +import com.pengrad.telegrambot.request.PinChatMessage; import com.pengrad.telegrambot.request.SendSticker; +import com.pengrad.telegrambot.response.SendResponse; import static cc.sukazyo.cono.morny.Log.logger; @@ -33,7 +35,8 @@ public class MedicationTimer extends Thread { } private static void sendNotification () { - MornyCoeur.extra().exec(new SendSticker(NOTIFY_RECEIVE_CHAT, TelegramStickers.ID_PROGYNOVA)); + SendResponse m = MornyCoeur.extra().exec(new SendSticker(NOTIFY_RECEIVE_CHAT, TelegramStickers.ID_PROGYNOVA)); + if (m.isOk()) MornyCoeur.extra().exec(new PinChatMessage(NOTIFY_RECEIVE_CHAT, m.message().messageId())); } private static long calcNextRoutineTimestamp () {