Update guide_getting_started.md

文档更新
This commit is contained in:
EricTianC 2020-06-19 09:38:26 +08:00 committed by GitHub
parent 854e2e8cda
commit 6990a2eead
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,7 @@
```groovy
dependencies {
implementation 'net.mamoe:mirai-core-qqandroid:0.32.0'//此处版本应替换为当前最新
implementation 'net.mamoe:mirai-core-qqandroid:1.1-EA'//此处版本应替换为当前最新
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
@ -78,6 +78,9 @@ package net.mamoe.mirai.simpleloader
import kotlinx.coroutines.*
import net.mamoe.mirai.Bot
import net.mamoe.mirai.alsoLogin
import net.mamoe.mirai.join
import net.mamoe.mirai.message.data.At
import net.mamoe.mirai.contact.Member
import net.mamoe.mirai.event.subscribeMessages
suspend fun main() {
@ -87,11 +90,11 @@ suspend fun main() {
miraiBot.subscribeMessages {
"你好" reply "你好!"
case("at me") {
reply(sender.at() + " 给爷爬 ")
reply(At(sender as Member) + " 给爷爬 ")
}
(contains("舔") or contains("刘老板")) {
"刘老板太强了".reply()
reply("刘老板太强了")
}
}
miraiBot.join() // 等待 Bot 离线, 避免主线程退出