Skip to content

Commit

Permalink
修复构建: 移除旧 API
Browse files Browse the repository at this point in the history
  • Loading branch information
ApliNi committed Oct 1, 2024
1 parent 7987bbb commit 3682be7
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/main/java/io/github/aplini/chat2qq/utils/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import io.github.aplini.chat2qq.Chat2QQ;
import me.clip.placeholderapi.PlaceholderAPI;
import me.dreamvoid.miraimc.api.MiraiBot;
import me.dreamvoid.miraimc.httpapi.MiraiHttpAPI;
import me.dreamvoid.miraimc.httpapi.exception.AbnormalStatusException;
import org.bukkit.plugin.Plugin;

import java.io.IOException;
Expand All @@ -27,13 +25,7 @@ public static void sendToGroup(long botID, long groupID, String message) {
try {
MiraiBot.getBot(botID).getGroup(groupID).sendMessageMirai(message);
} catch (NoSuchElementException e) {
if (MiraiHttpAPI.Bots.containsKey(botID)) {
try {
MiraiHttpAPI.INSTANCE.sendGroupMessage(MiraiHttpAPI.Bots.get(botID), groupID, message);
} catch (IOException | AbnormalStatusException ex) {
getLogger().warning("[Chat2QQ] 发送消息出现异常: "+ botID +": "+ ex);
}
} else getLogger().warning("[Chat2QQ] 指定QQ账号不存在: "+ botID);
getLogger().warning("[Chat2QQ] 发送消息出现异常: botID="+ botID +" -> groupID="+ groupID +": "+ e);
}
}
// 简化调用
Expand Down

0 comments on commit 3682be7

Please sign in to comment.