This commit is contained in:
Yutousama 2023-02-23 17:21:57 +08:00
parent 211773a230
commit eb4264628d
3 changed files with 14 additions and 4 deletions

View File

@ -35,7 +35,7 @@
<dependency>
<groupId>net.mamoe</groupId>
<artifactId>mirai-core-jvm</artifactId>
<version>2.12.0</version>
<version>2.14.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>

View File

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

View File

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