mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-27 08:50:15 +08:00
Console version checker
This commit is contained in:
parent
d51afcfbaa
commit
592d28044e
@ -68,10 +68,10 @@ object ConsoleUpdator{
|
|||||||
).asSequence()
|
).asSequence()
|
||||||
.map { it.value.drop(1).dropLast(1) }
|
.map { it.value.drop(1).dropLast(1) }
|
||||||
.maxBy {
|
.maxBy {
|
||||||
it.split('.').foldRightIndexed(0) { index: Int, s: String, acc: Int ->
|
it.split('.').foldRightIndexed(0) { index: Int, s: String, acc: Int ->
|
||||||
acc + 100.0.pow(2 - index).toInt() * (s.toIntOrNull() ?: 0)
|
acc + 100.0.pow(2 - index).toInt() * (s.toIntOrNull() ?: 0)
|
||||||
}
|
}
|
||||||
}!!
|
}!!
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
println("Failed to fetch newest Console version, please seek for help")
|
println("Failed to fetch newest Console version, please seek for help")
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
|
Loading…
Reference in New Issue
Block a user