From 8f8fa41acf03654589b1697b0bfbce4fd5f8abe4 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Fri, 5 Aug 2022 10:45:16 +0800 Subject: [PATCH] =?UTF-8?q?update:=E6=B6=A9=E5=9B=BE=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=9B=9E=E6=89=A7=20fix:=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A4=A7=E5=A4=B4=E8=8F=9C=E6=A8=A1=E5=9D=97=E6=9C=AA=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E6=B5=8F=E8=A7=88=E5=99=A8=20del:=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=9C=AA=E4=BD=BF=E7=94=A8import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yutou/qqbot/QQBotManager.java | 13 ------------- .../yutou/qqbot/models/Animal/TurnipProphet.java | 8 +++----- .../java/com/yutou/qqbot/models/setu/GetSeTu.java | 3 ++- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/yutou/qqbot/QQBotManager.java b/src/main/java/com/yutou/qqbot/QQBotManager.java index dfc74d4..2d06898 100644 --- a/src/main/java/com/yutou/qqbot/QQBotManager.java +++ b/src/main/java/com/yutou/qqbot/QQBotManager.java @@ -3,19 +3,6 @@ package com.yutou.qqbot; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.yutou.qqbot.Listeners.QQMessageListener; -import com.yutou.qqbot.models.Animal.TurnipProphet; -import com.yutou.qqbot.models.Commands.BTDownload; -import com.yutou.qqbot.models.Commands.BaiduDown; -import com.yutou.qqbot.models.Commands.Bangumi; -import com.yutou.qqbot.models.Commands.Moyu; -import com.yutou.qqbot.models.Commands.System.*; -import com.yutou.qqbot.models.Model; -import com.yutou.qqbot.models.WebSign.BaiHeHui; -import com.yutou.qqbot.models.WebSign.BiliBiliMangeSign; -import com.yutou.qqbot.models.WebSign.Tsdm; -import com.yutou.qqbot.models.XiaoMi.MiRouter; -import com.yutou.qqbot.models.setu.GetSeTu; -import com.yutou.qqbot.models.setu.QQSetu; import com.yutou.qqbot.utlis.*; import net.mamoe.mirai.Bot; import net.mamoe.mirai.BotFactory; diff --git a/src/main/java/com/yutou/qqbot/models/Animal/TurnipProphet.java b/src/main/java/com/yutou/qqbot/models/Animal/TurnipProphet.java index 162f0ea..2ca1368 100644 --- a/src/main/java/com/yutou/qqbot/models/Animal/TurnipProphet.java +++ b/src/main/java/com/yutou/qqbot/models/Animal/TurnipProphet.java @@ -304,7 +304,7 @@ public class TurnipProphet extends Model { public Map openTurnip(String prices, String pattern) throws Exception { - String url = String.format("http://127.0.0.1:7000/?prices=%s%s", + String url = String.format("http://192.168.31.88:7000/?prices=%s%s", prices, pattern == null ? "" : "&pattern=" + pattern ); @@ -322,8 +322,7 @@ public class TurnipProphet extends Model { JSONObject pr = new JSONObject(); JSONArray array = new JSONArray(); if (list.size() == 0) { - driver.close(); - driver.quit(); + WebClient.getInstance().quit(); return null; } @@ -380,8 +379,7 @@ public class TurnipProphet extends Model { map.put(TurnipProphet.TurnipData.DAY, maxDay); pr.put(TurnipProphet.TurnipData.MODEL, array); map.put(TurnipProphet.TurnipData.MODEL, pr.toJSONString()); - driver.close(); - driver.quit(); + WebClient.getInstance().quit(); return map; } } 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 6de52a0..3de3d28 100644 --- a/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java +++ b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java @@ -213,7 +213,8 @@ public class GetSeTu extends Model { @Override public void onDownload(File file) { super.onDownload(file); - QQBotManager.getInstance().sendMessage(file, qq, event.getMessage(), builder.toString()); + String message = QQBotManager.getInstance().sendMessage(file, qq, event.getMessage(), builder.toString()); + Log.i(getModelName(),message); } @Override