mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-08 06:47:05 +08:00
Add equals
This commit is contained in:
parent
22f2c5087e
commit
69f1ee2cf2
@ -18,16 +18,11 @@ object MiraiHttpAPIServer {
|
|||||||
@UseExperimental(KtorExperimentalAPI::class)
|
@UseExperimental(KtorExperimentalAPI::class)
|
||||||
fun start(
|
fun start(
|
||||||
port: Int = 8080,
|
port: Int = 8080,
|
||||||
authKey: String? = null,
|
authKey: String,
|
||||||
callback: (() -> Unit)? = null
|
callback: (() -> Unit)? = null
|
||||||
) {
|
) {
|
||||||
authKey?.apply {
|
require(authKey.length in 8..128) { "Expected authKey length is between 8 to 128" }
|
||||||
if (authKey.length in 8..128) {
|
SessionManager.authKey = authKey
|
||||||
SessionManager.authKey = authKey
|
|
||||||
} else {
|
|
||||||
logger.error("Expected authKey length is between 8 to 128")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: start是无阻塞的,理应获取启动状态后再执行后续代码
|
// TODO: start是无阻塞的,理应获取启动状态后再执行后续代码
|
||||||
try {
|
try {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package net.mamoe.mirai.qqandroid
|
package net.mamoe.mirai.qqandroid
|
||||||
|
|
||||||
import kotlinx.coroutines.async
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import net.mamoe.mirai.contact.*
|
import net.mamoe.mirai.contact.*
|
||||||
import net.mamoe.mirai.data.FriendNameRemark
|
import net.mamoe.mirai.data.FriendNameRemark
|
||||||
@ -60,6 +59,9 @@ internal class QQImpl(bot: QQAndroidBot, override val coroutineContext: Coroutin
|
|||||||
TODO("not implemented")
|
TODO("not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
return other is QQ && other.id == this.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -108,6 +110,9 @@ internal class MemberImpl(
|
|||||||
return mute(0)
|
return mute(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
return other is Member && other.id == this.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -325,4 +330,8 @@ internal class GroupImpl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
return other is Group && other.id == this.id
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user