dev_该合并了 #8
@ -4,6 +4,7 @@ import com.yutou.qqbot.Annotations.UseModel;
|
|||||||
import com.yutou.qqbot.QQBotManager;
|
import com.yutou.qqbot.QQBotManager;
|
||||||
import com.yutou.qqbot.models.Model;
|
import com.yutou.qqbot.models.Model;
|
||||||
import com.yutou.qqbot.utlis.AppTools;
|
import com.yutou.qqbot.utlis.AppTools;
|
||||||
|
import com.yutou.qqbot.utlis.RedisTools;
|
||||||
import net.mamoe.mirai.event.events.MessageEvent;
|
import net.mamoe.mirai.event.events.MessageEvent;
|
||||||
import net.mamoe.mirai.message.data.MessageChainBuilder;
|
import net.mamoe.mirai.message.data.MessageChainBuilder;
|
||||||
import net.mamoe.mirai.message.data.QuoteReply;
|
import net.mamoe.mirai.message.data.QuoteReply;
|
||||||
@ -30,11 +31,13 @@ public class PaoPaoSleepWaring extends Model {
|
|||||||
@Override
|
@Override
|
||||||
public void onMessage(Long qq, MessageEvent event, boolean isGroup) {
|
public void onMessage(Long qq, MessageEvent event, boolean isGroup) {
|
||||||
super.onMessage(qq, event, isGroup);
|
super.onMessage(qq, event, isGroup);
|
||||||
if(Integer.parseInt(AppTools.getHours())>=22 && event.getSource().getFromId() == 914520754){
|
if(Integer.parseInt(AppTools.getHours())>=22 && event.getSource().getFromId() == 914520754
|
||||||
|
&& "true".equals(RedisTools.get("paopao_sleep_"+AppTools.getToDayTime(),"false"))){
|
||||||
MessageChainBuilder builder=new MessageChainBuilder();
|
MessageChainBuilder builder=new MessageChainBuilder();
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user