mirror of
https://github.com/mamoe/mirai.git
synced 2025-04-09 02:10:10 +08:00
Review: misc improvements
This commit is contained in:
parent
48a2d9caff
commit
be63ec48fa
build.gradle
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact
12
build.gradle
12
build.gradle
@ -1,18 +1,18 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url "https://mirrors.huaweicloud.com/repository/maven" }
|
||||
maven { url 'https://mirrors.huaweicloud.com/repository/maven' }
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
google()
|
||||
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
|
||||
maven { url 'https://dl.bintray.com/kotlin/kotlin-dev/'}
|
||||
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
|
||||
maven { url 'https://dl.bintray.com/kotlin/kotlin-dev' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||
classpath("com.github.jengelman.gradle.plugins:shadow:5.2.0")
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion"
|
||||
classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicFuVersion"
|
||||
}
|
||||
@ -27,7 +27,9 @@ try {
|
||||
} else {
|
||||
project.ext.set("isAndroidSDKAvailable", false)
|
||||
}
|
||||
}catch(Exception e){}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
allprojects {
|
||||
group = "net.mamoe"
|
||||
version = getProperty("mirai_version")
|
||||
|
@ -75,11 +75,11 @@ internal abstract class QQAndroidBotBase constructor(
|
||||
|
||||
// internally visible only
|
||||
fun getGroupByUin(uin: Long): Group {
|
||||
return groups.delegate.filteringGetOrNull { (it as GroupImpl).uin == uin } ?: throw NoSuchElementException("Can not found group with ID=${uin}")
|
||||
return groups.delegate.getOrNull(uin) ?: throw NoSuchElementException("Can not found group with ID=${uin}")
|
||||
}
|
||||
|
||||
fun getGroupByUinOrNull(uin: Long): Group? {
|
||||
return groups.delegate.filteringGetOrNull { (it as GroupImpl).uin == uin }
|
||||
return groups.delegate.getOrNull(uin)
|
||||
}
|
||||
|
||||
override suspend fun queryGroupList(): Sequence<Long> {
|
||||
|
@ -16,6 +16,8 @@ import net.mamoe.mirai.utils.*
|
||||
|
||||
/**
|
||||
* 只读联系人列表, lock-free 实现
|
||||
*
|
||||
* @see ContactList.asSequence
|
||||
*/
|
||||
@UseExperimental(MiraiInternalAPI::class)
|
||||
@Suppress("unused")
|
||||
|
Loading…
Reference in New Issue
Block a user