diff --git a/onebot/src/main/java/cn/evole/onebot/sdk/event/message/MessageEvent.java b/onebot/src/main/java/cn/evole/onebot/sdk/event/message/MessageEvent.java index 91c5cd27..2eefb516 100644 --- a/onebot/src/main/java/cn/evole/onebot/sdk/event/message/MessageEvent.java +++ b/onebot/src/main/java/cn/evole/onebot/sdk/event/message/MessageEvent.java @@ -1,17 +1,12 @@ package cn.evole.onebot.sdk.event.message; -import cn.evole.onebot.sdk.entity.MsgChainBean; import cn.evole.onebot.sdk.event.Event; -import com.google.gson.JsonArray; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import java.util.List; - /** * @author cnlimiter */ diff --git a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/ConnectFactory.kt b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/ConnectFactory.kt index c41c2d21..3b23584c 100644 --- a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/ConnectFactory.kt +++ b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/ConnectFactory.kt @@ -5,7 +5,6 @@ import cn.evolvefield.onebot.client.core.Bot import cn.evolvefield.onebot.client.handler.ActionHandler import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope -import me.him188.kotlin.jvm.blocking.bridge.JvmBlockingBridge import org.slf4j.Logger import org.slf4j.LoggerFactory import java.net.InetSocketAddress diff --git a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/WSClient.kt b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/WSClient.kt index 551de6a2..2a11155b 100644 --- a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/WSClient.kt +++ b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/WSClient.kt @@ -6,16 +6,14 @@ import cn.evolvefield.onebot.client.handler.ActionHandler import cn.evolvefield.onebot.client.handler.EventBus import cn.evolvefield.onebot.client.util.ActionSendUtils import com.google.gson.JsonSyntaxException -import kotlinx.coroutines.* -import kotlinx.coroutines.channels.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.launch import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import org.java_websocket.client.WebSocketClient import org.java_websocket.handshake.ServerHandshake import org.slf4j.Logger -import org.slf4j.LoggerFactory import java.net.URI -import kotlin.coroutines.CoroutineContext /** * Project: onebot-client diff --git a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/WSServer.kt b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/WSServer.kt index 3f658f4f..ba02461f 100644 --- a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/WSServer.kt +++ b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/connection/WSServer.kt @@ -6,20 +6,16 @@ import cn.evolvefield.onebot.client.handler.ActionHandler import cn.evolvefield.onebot.client.handler.EventBus import cn.evolvefield.onebot.client.util.ActionSendUtils import com.google.gson.JsonSyntaxException -import kotlinx.coroutines.* -import kotlinx.coroutines.channels.* +import kotlinx.coroutines.CompletableDeferred +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.launch import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import org.java_websocket.WebSocket -import org.java_websocket.client.WebSocketClient import org.java_websocket.handshake.ClientHandshake -import org.java_websocket.handshake.ServerHandshake import org.java_websocket.server.WebSocketServer import org.slf4j.Logger -import org.slf4j.LoggerFactory import java.net.InetSocketAddress -import java.net.URI -import kotlin.coroutines.CoroutineContext /** * Project: onebot-client diff --git a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/core/Bot.kt b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/core/Bot.kt index f0667ea5..186baa7e 100644 --- a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/core/Bot.kt +++ b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/core/Bot.kt @@ -18,7 +18,6 @@ import cn.evole.onebot.sdk.response.guild.* import cn.evole.onebot.sdk.response.misc.* import cn.evole.onebot.sdk.util.json.GsonUtil import cn.evole.onebot.sdk.util.json.JsonsObject -import cn.evolvefield.onebot.client.connection.WSClient import cn.evolvefield.onebot.client.handler.ActionHandler import com.google.gson.* import com.google.gson.reflect.TypeToken diff --git a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/handler/ActionHandler.kt b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/handler/ActionHandler.kt index 0b489733..13c081dc 100644 --- a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/handler/ActionHandler.kt +++ b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/handler/ActionHandler.kt @@ -7,8 +7,6 @@ import cn.evolvefield.onebot.client.util.ActionSendUtils import com.google.gson.JsonObject import org.java_websocket.WebSocket import org.slf4j.Logger -import org.slf4j.LoggerFactory -import java.net.ConnectException /** * Description: diff --git a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/util/ActionSendUtils.kt b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/util/ActionSendUtils.kt index e8049f8d..8b5a5a08 100644 --- a/onebot/src/main/kotlin/cn/evolvefield/onebot/client/util/ActionSendUtils.kt +++ b/onebot/src/main/kotlin/cn/evolvefield/onebot/client/util/ActionSendUtils.kt @@ -2,7 +2,6 @@ package cn.evolvefield.onebot.client.util import cn.evole.onebot.sdk.util.json.JsonsObject import com.google.gson.JsonObject -import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.TimeoutCancellationException import kotlinx.coroutines.sync.Mutex @@ -10,7 +9,6 @@ import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.withTimeout import org.java_websocket.WebSocket import org.slf4j.Logger -import org.slf4j.LoggerFactory /** * Description: diff --git a/overflow-core/src/main/kotlin/net/mamoe/mirai/internal/network/components/EventDispatcher.kt b/overflow-core/src/main/kotlin/net/mamoe/mirai/internal/network/components/EventDispatcher.kt index d6465fbc..4154cd93 100644 --- a/overflow-core/src/main/kotlin/net/mamoe/mirai/internal/network/components/EventDispatcher.kt +++ b/overflow-core/src/main/kotlin/net/mamoe/mirai/internal/network/components/EventDispatcher.kt @@ -9,7 +9,6 @@ import net.mamoe.mirai.internal.event.InternalEventMechanism import net.mamoe.mirai.utils.* import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext -import kotlin.jvm.JvmInline /** * All events will be caught and forwarded to [EventDispatcher]. Invocation of [Event.broadcast] and [EventDispatcher.broadcast] are effectively equal. diff --git a/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/Overflow.kt b/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/Overflow.kt index eae7512a..8fff704b 100644 --- a/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/Overflow.kt +++ b/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/Overflow.kt @@ -31,7 +31,6 @@ import top.mrxiaom.overflow.OverflowAPI import top.mrxiaom.overflow.internal.contact.BotWrapper import top.mrxiaom.overflow.internal.contact.BotWrapper.Companion.wrap import top.mrxiaom.overflow.internal.contact.FriendWrapper -import top.mrxiaom.overflow.internal.contact.GroupWrapper import top.mrxiaom.overflow.internal.contact.StrangerWrapper import top.mrxiaom.overflow.internal.data.asMirai import top.mrxiaom.overflow.internal.listener.* diff --git a/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/contact/BotWrapper.kt b/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/contact/BotWrapper.kt index f1ea4c66..9c784365 100644 --- a/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/contact/BotWrapper.kt +++ b/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/contact/BotWrapper.kt @@ -17,9 +17,9 @@ import net.mamoe.mirai.message.data.MessageChain import net.mamoe.mirai.supervisorJob import net.mamoe.mirai.utils.* import org.java_websocket.framing.CloseFrame -import top.mrxiaom.overflow.internal.Overflow import top.mrxiaom.overflow.contact.RemoteBot import top.mrxiaom.overflow.contact.Updatable +import top.mrxiaom.overflow.internal.Overflow import top.mrxiaom.overflow.internal.data.FriendInfoImpl import top.mrxiaom.overflow.internal.data.StrangerInfoImpl import top.mrxiaom.overflow.internal.message.OnebotMessages diff --git a/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/message/data/WrappedImageProtocol.kt b/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/message/data/WrappedImageProtocol.kt index 00bd141b..62a2504d 100644 --- a/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/message/data/WrappedImageProtocol.kt +++ b/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/message/data/WrappedImageProtocol.kt @@ -4,15 +4,11 @@ package top.mrxiaom.overflow.internal.message.data import kotlinx.serialization.Serializable import net.mamoe.mirai.Bot import net.mamoe.mirai.contact.Contact -import net.mamoe.mirai.contact.Group -import net.mamoe.mirai.contact.User import net.mamoe.mirai.message.data.Image import net.mamoe.mirai.message.data.ImageType import net.mamoe.mirai.message.data.InternalImageProtocol import net.mamoe.mirai.utils.MiraiExperimentalApi import net.mamoe.mirai.utils.MiraiInternalApi -import net.mamoe.mirai.utils.cast -import net.mamoe.mirai.utils.toUHexString @OptIn(MiraiInternalApi::class) internal class WrappedImageProtocol : InternalImageProtocol { diff --git a/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/plugin/OverflowCoreAsPlugin.kt b/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/plugin/OverflowCoreAsPlugin.kt index deede265..42b9e567 100644 --- a/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/plugin/OverflowCoreAsPlugin.kt +++ b/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/plugin/OverflowCoreAsPlugin.kt @@ -19,7 +19,6 @@ import net.mamoe.mirai.console.util.ConsoleExperimentalApi import net.mamoe.mirai.console.util.SemVersion import net.mamoe.mirai.utils.weeksToMillis import org.java_websocket.client.WebSocketClient -import top.mrxiaom.overflow.BuildConstants import top.mrxiaom.overflow.internal.Overflow import top.mrxiaom.overflow.internal.asOnebot import top.mrxiaom.overflow.internal.message.OnebotMessages diff --git a/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/utils/ResourceUtils.kt b/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/utils/ResourceUtils.kt index b0e05bbd..e981f950 100644 --- a/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/utils/ResourceUtils.kt +++ b/overflow-core/src/main/kotlin/top/mrxiaom/overflow/internal/utils/ResourceUtils.kt @@ -1,22 +1,7 @@ package top.mrxiaom.overflow.internal.utils -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.withContext -import kotlinx.serialization.KSerializer -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable -import kotlinx.serialization.json.Json -import kotlinx.serialization.json.JsonElement -import kotlinx.serialization.json.JsonNull -import net.mamoe.mirai.utils.CheckableResponseA import net.mamoe.mirai.utils.ExternalResource -import net.mamoe.mirai.utils.JsonStruct -import net.mamoe.mirai.utils.loadAs -import top.mrxiaom.overflow.internal.contact.BotWrapper import java.io.* -import java.net.HttpURLConnection -import java.net.URL -import java.net.URLEncoder import java.util.* fun ExternalResource.toBase64File(): String {