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); } } }