From 083218b1cb132e29feceda13c80f432eaeec9067 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Sun, 20 Nov 2022 19:07:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=AF=9B=E6=AF=9B=E6=8F=90?= =?UTF-8?q?=E9=86=92=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=B3=A1=E6=B3=A1=E6=8F=90?= =?UTF-8?q?=E9=86=92=E4=B8=BA=E4=B8=80=E5=B0=8F=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/Commands/MaoMaoWorkWaring.java | 43 +++++++++++++++++++ .../models/Commands/PaoPaoSleepWaring.java | 4 +- 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/yutou/qqbot/models/Commands/MaoMaoWorkWaring.java diff --git a/src/main/java/com/yutou/qqbot/models/Commands/MaoMaoWorkWaring.java b/src/main/java/com/yutou/qqbot/models/Commands/MaoMaoWorkWaring.java new file mode 100644 index 0000000..12c4e88 --- /dev/null +++ b/src/main/java/com/yutou/qqbot/models/Commands/MaoMaoWorkWaring.java @@ -0,0 +1,43 @@ +package com.yutou.qqbot.models.Commands; + +import com.yutou.qqbot.Annotations.UseModel; +import com.yutou.qqbot.QQBotManager; +import com.yutou.qqbot.models.Model; +import com.yutou.qqbot.utlis.AppTools; +import com.yutou.qqbot.utlis.RedisTools; +import net.mamoe.mirai.event.events.MessageEvent; +import net.mamoe.mirai.message.data.MessageChainBuilder; +import net.mamoe.mirai.message.data.QuoteReply; + +import static com.yutou.qqbot.models.Model.QQGroupCommands.QQ_TIMEOUT; + +@UseModel +public class MaoMaoWorkWaring extends Model { + @Override + public boolean isUserPublic() { + return true; + } + + @Override + public String[] getUsePowers() { + return new String[]{QQ_TIMEOUT}; + } + + @Override + public String getModelName() { + return "毛毛工作提醒"; + } + + @Override + public void onMessage(Long qq, MessageEvent event, boolean isGroup) { + super.onMessage(qq, event, isGroup); + if(Integer.parseInt(AppTools.getHours())>=6 && event.getSource().getFromId() == 526306604 + && "false".equals(RedisTools.get("maomao_work_"+AppTools.getToDayTime(),"false"))){ + MessageChainBuilder builder=new MessageChainBuilder(); + builder.append(new QuoteReply(event.getMessage())); + builder.append("别水了,快去打工,没钱氪老婆了"); + QQBotManager.getInstance().sendMessage(qq,builder); + RedisTools.set("maomao_work_"+AppTools.getToDayTime(),"true",20*60*60); + } + } +} diff --git a/src/main/java/com/yutou/qqbot/models/Commands/PaoPaoSleepWaring.java b/src/main/java/com/yutou/qqbot/models/Commands/PaoPaoSleepWaring.java index 0b1f690..d21288a 100644 --- a/src/main/java/com/yutou/qqbot/models/Commands/PaoPaoSleepWaring.java +++ b/src/main/java/com/yutou/qqbot/models/Commands/PaoPaoSleepWaring.java @@ -25,7 +25,7 @@ public class PaoPaoSleepWaring extends Model { @Override public String getModelName() { - return "paopao"; + return "泡泡提醒"; } @Override @@ -37,7 +37,7 @@ public class PaoPaoSleepWaring extends Model { builder.append(new QuoteReply(event.getMessage())); builder.append("别水了,该睡了~"); QQBotManager.getInstance().sendMessage(qq,builder); - RedisTools.set("paopao_sleep_"+AppTools.getToDayTime(),"true",2*60*60); + RedisTools.set("paopao_sleep_"+AppTools.getToDayTime(),"true",1*60*60); } } }