Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXiaoM committed Dec 4, 2023
1 parent 4f59a4f commit 1c01fde
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ 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
import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.withTimeout
import org.java_websocket.WebSocket
import org.slf4j.Logger
import org.slf4j.LoggerFactory

/**
* Description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit 1c01fde

Please sign in to comment.