mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-15 13:00:12 +08:00
Merge pull request #379 from EricTianC/patch-1
Update guide_getting_started.md
This commit is contained in:
commit
995078351d
@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
dependencies {
|
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"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
}
|
}
|
||||||
@ -78,6 +78,9 @@ package net.mamoe.mirai.simpleloader
|
|||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import net.mamoe.mirai.Bot
|
import net.mamoe.mirai.Bot
|
||||||
import net.mamoe.mirai.alsoLogin
|
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
|
import net.mamoe.mirai.event.subscribeMessages
|
||||||
|
|
||||||
suspend fun main() {
|
suspend fun main() {
|
||||||
@ -87,11 +90,11 @@ suspend fun main() {
|
|||||||
miraiBot.subscribeMessages {
|
miraiBot.subscribeMessages {
|
||||||
"你好" reply "你好!"
|
"你好" reply "你好!"
|
||||||
case("at me") {
|
case("at me") {
|
||||||
reply(sender.at() + " 给爷爬 ")
|
reply(At(sender as Member) + " 给爷爬 ")
|
||||||
}
|
}
|
||||||
|
|
||||||
(contains("舔") or contains("刘老板")) {
|
(contains("舔") or contains("刘老板")) {
|
||||||
"刘老板太强了".reply()
|
reply("刘老板太强了")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
miraiBot.join() // 等待 Bot 离线, 避免主线程退出
|
miraiBot.join() // 等待 Bot 离线, 避免主线程退出
|
||||||
|
Loading…
Reference in New Issue
Block a user