From 0ab5634ce327fe28366c07dc452722d741cde192 Mon Sep 17 00:00:00 2001 From: LamGC Date: Fri, 17 Apr 2020 15:52:58 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20MiraiMain=20=E5=B0=86=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=AF=86=E7=A0=81=E5=BD=A2=E5=BC=8F=E7=94=B1=E6=98=8E?= =?UTF-8?q?=E6=96=87=E6=96=87=E6=9C=AC=E6=9B=B4=E6=94=B9=E4=B8=BAMd5?= =?UTF-8?q?=E4=BB=A5=E5=8A=A0=E5=BC=BA=E6=9C=BA=E5=99=A8=E4=BA=BA=E5=9C=A8?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=AB=AF=E7=9A=84=E5=AE=89=E5=85=A8=E6=80=A7?= =?UTF-8?q?;=20[Update]=20pom.xml=20=E7=89=88=E6=9C=AC=E5=8F=B7=E5=8D=87?= =?UTF-8?q?=E7=BA=A7(1.0-SNAPSHOT=20->=202.1.0);?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- src/main/java/net/lamgc/cgj/bot/MiraiMain.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 735f8d1..c5d6f03 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.example CGJ_2 - 1.0-SNAPSHOT + 2.1.0 diff --git a/src/main/java/net/lamgc/cgj/bot/MiraiMain.java b/src/main/java/net/lamgc/cgj/bot/MiraiMain.java index e64ace8..cb2348d 100644 --- a/src/main/java/net/lamgc/cgj/bot/MiraiMain.java +++ b/src/main/java/net/lamgc/cgj/bot/MiraiMain.java @@ -8,6 +8,7 @@ import net.mamoe.mirai.message.FriendMessage; import net.mamoe.mirai.message.GroupMessage; import net.mamoe.mirai.qqandroid.QQAndroid; import net.mamoe.mirai.utils.BotConfiguration; +import org.apache.commons.net.util.Base64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,7 +39,7 @@ public class MiraiMain implements Closeable { return; } - bot = QQAndroid.INSTANCE.newBot(Long.parseLong(botProperties.getProperty("bot.qq", "0")), botProperties.getProperty("bot.password", ""), new BotConfiguration()); + bot = QQAndroid.INSTANCE.newBot(Long.parseLong(botProperties.getProperty("bot.qq", "0")), Base64.decodeBase64(botProperties.getProperty("bot.password", "")), new BotConfiguration()); Events.subscribeAlways(GroupMessage.class, (msg) -> BotEventHandler.executor.executor(new MiraiMessageEvent(msg))); Events.subscribeAlways(FriendMessage.class, (msg) -> BotEventHandler.executor.executor(new MiraiMessageEvent(msg))); bot.login();