From eb4264628d36243705bd29485b16133562c4a048 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Thu, 23 Feb 2023 17:21:57 +0800 Subject: [PATCH] update --- pom.xml | 2 +- .../qqbot/models/Commands/PaoPaoSleepWaring.java | 3 +++ .../java/com/yutou/qqbot/models/setu/GetSeTu.java | 13 ++++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 7dcee9d..58dab18 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ net.mamoe mirai-core-jvm - 2.12.0 + 2.14.0 org.jetbrains.kotlinx 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 d21288a..9f271c3 100644 --- a/src/main/java/com/yutou/qqbot/models/Commands/PaoPaoSleepWaring.java +++ b/src/main/java/com/yutou/qqbot/models/Commands/PaoPaoSleepWaring.java @@ -39,5 +39,8 @@ public class PaoPaoSleepWaring extends Model { QQBotManager.getInstance().sendMessage(qq,builder); RedisTools.set("paopao_sleep_"+AppTools.getToDayTime(),"true",1*60*60); } + if(event.getSource().getFromId() == 914520754 && msg.contains("#\u4f53\u529b")){ + QQBotManager.getInstance().sendMessage(qq, "\u60e0\u57ce\uff01"); + } } } diff --git a/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java index b712286..115fb6f 100644 --- a/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java +++ b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java @@ -157,12 +157,19 @@ public class GetSeTu extends Model { RedisTools.set("Setu_" + qq, array.toString()); } } - - private boolean getSeTu(String model, String key, boolean r18, boolean fuzzyR18, Long qq, MessageEvent event) { + private boolean getSeTu(String model, String key, boolean r18, boolean fuzzyR18, Long qq, MessageEvent event){ + return getSeTu(model, key, r18, fuzzyR18, qq, event,3); + } + private boolean getSeTu(String model,String key, boolean r18, boolean fuzzyR18, Long qq, MessageEvent event,int reset) { + if(reset<=0){ + QQBotManager.getInstance().sendMessage(qq, "获取失败喵~"); + return false; + } String url = "https://api.lolicon.app/setu/v2?r18=0&size=regular"; if (r18) { url = "https://api.lolicon.app/setu/v2?r18=1&size=regular"; } + final String tmpKey=key; if (!StringUtils.isEmpty(key)) { if ("tag".equals(model)) { String[] keys = key.split(" "); @@ -228,7 +235,7 @@ public class GetSeTu extends Model { @Override public void onError(Exception e) { super.onError(e); - QQBotManager.getInstance().sendMessage(qq, "获取失败喵~"); + getSeTu(model, tmpKey, r18, fuzzyR18, qq, event, reset-1); e.printStackTrace(); } });