From f30530d61d4f7caa9d1948d3e9000c74ecae4a70 Mon Sep 17 00:00:00 2001
From: Yutousama <583819556@qq.com>
Date: Tue, 14 Sep 2021 01:19:05 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9Amirai=E5=8D=87?=
=?UTF-8?q?=E7=BA=A7=E5=88=B02.7.0=20=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96idea=E6=BF=80=E6=B4=BB=E7=A0=81=E5=A4=B1=E8=B4=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 19 +++++++++++++------
.../java/com/yutou/nas/utils/IdeaTools.java | 2 +-
.../com/yutou/nas/utils/QQBotManager.java | 3 ++-
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/pom.xml b/pom.xml
index 7fb2907..ce6bee0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
NAS Service
1.8
- 1.4.10
+ 1.5.10
@@ -96,13 +96,19 @@
net.mamoe
mirai-core-jvm
- 2.6.7
+ 2.7.0
- org.jetbrains.kotlin
- kotlin-stdlib
- ${kotlin.version}
+ org.jetbrains.kotlinx
+ kotlinx-coroutines-jdk8
+ 1.5.2
+
+ org.jetbrains.kotlinx
+ kotlinx-coroutines-core-jvm
+ 1.5.2
+
+
net.bramp.ffmpeg
ffmpeg
@@ -163,7 +169,8 @@
org.springframework.boot
spring-boot-maven-plugin
-
+
ZIP
com.yutou.nas.NasApplication
diff --git a/src/main/java/com/yutou/nas/utils/IdeaTools.java b/src/main/java/com/yutou/nas/utils/IdeaTools.java
index c3d2394..5f85fe0 100644
--- a/src/main/java/com/yutou/nas/utils/IdeaTools.java
+++ b/src/main/java/com/yutou/nas/utils/IdeaTools.java
@@ -20,7 +20,7 @@ public class IdeaTools {
try {
ZipFile zipFile = new ZipFile(file, Charset.forName("gbk"));
String data = "";
- if (file.exists()) {
+ if (file.exists()&&zipFile.getEntry(name)!=null) {
data = StreamTools.streamReadLine(zipFile.getInputStream(zipFile.getEntry(name)));
}
zipFile.close();
diff --git a/src/main/java/com/yutou/nas/utils/QQBotManager.java b/src/main/java/com/yutou/nas/utils/QQBotManager.java
index 99c161d..2ab0f0d 100644
--- a/src/main/java/com/yutou/nas/utils/QQBotManager.java
+++ b/src/main/java/com/yutou/nas/utils/QQBotManager.java
@@ -228,6 +228,7 @@ public class QQBotManager {
private void myGroup(String msg) {
StringBuilder builder;
+ String msgSrc=msg;
msg = msg.replace("!", "!").toLowerCase();
Log.i("QQBot","command = "+msg);
switch (msg) {
@@ -319,7 +320,7 @@ public class QQBotManager {
} else if (msg.startsWith(QQCommands.QQ_AUDIO)) {
QQAudio.playText(msg.replace(QQCommands.QQ_AUDIO, ""));
}else if(msg.startsWith(QQCommands.QQ_TOOLS_IDEA_FILE)){
- getInstance().sendMessage(IdeaTools.getIdea(msg.replace(QQCommands.QQ_TOOLS_IDEA_FILE,"")));
+ getInstance().sendMessage(IdeaTools.getIdea(msgSrc.replace(QQCommands.QQ_TOOLS_IDEA_FILE,"")));
}else if(msg.startsWith(QQCommands.QQ_TOOLS_IDEA_URL)){
RedisTools.set("ideaUrl",msg.replace(QQCommands.QQ_TOOLS_IDEA_URL,"").trim());
getInstance().sendMessage("已设定下载地址:"+RedisTools.get("ideaUrl"));