mirror of
https://github.com/jie65535/mirai-console-jnr-plugin.git
synced 2025-12-15 18:41:35 +08:00
refactor: 使用正则提取时间
This commit is contained in:
4
src/test/kotlin/RegexTest.kt
Normal file
4
src/test/kotlin/RegexTest.kt
Normal file
@@ -0,0 +1,4 @@
|
||||
fun main(){
|
||||
val regex = Regex("(?<=#group\\.mute(\\\\)?:)\\d+")
|
||||
println(regex.find("#group.mute:12345")?.value?.toLong())
|
||||
}
|
||||
@@ -7,8 +7,6 @@ import top.jie65535.jnr.JNudgeReply
|
||||
|
||||
@OptIn(ConsoleExperimentalApi::class)
|
||||
suspend fun main(){
|
||||
val s = "#group.mute:10"
|
||||
println(s.matches(Regex("#group.mute:\\d+")))
|
||||
MiraiConsoleTerminalLoader.startAsDaemon()
|
||||
JNudgeReply.load()
|
||||
JNudgeReply.enable()
|
||||
|
||||
Reference in New Issue
Block a user