新增毛毛提醒,修改泡泡提醒为一小时

This commit is contained in:
Yutousama 2022-11-20 19:07:56 +08:00
parent ae72956f68
commit 083218b1cb
2 changed files with 45 additions and 2 deletions

View File

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

View File

@ -25,7 +25,7 @@ public class PaoPaoSleepWaring extends Model {
@Override @Override
public String getModelName() { public String getModelName() {
return "paopao"; return "泡泡提醒";
} }
@Override @Override
@ -37,7 +37,7 @@ public class PaoPaoSleepWaring extends Model {
builder.append(new QuoteReply(event.getMessage())); builder.append(new QuoteReply(event.getMessage()));
builder.append("别水了,该睡了~"); builder.append("别水了,该睡了~");
QQBotManager.getInstance().sendMessage(qq,builder); 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);
} }
} }
} }