https://github.com/karinjs/kritor-kotlin
kritor 的 kotlin 实现
https://github.com/karinjs/kritor-kotlin
Last synced: over 1 year ago
JSON representation
kritor 的 kotlin 实现
- Host: GitHub
- URL: https://github.com/karinjs/kritor-kotlin
- Owner: KarinJS
- Created: 2024-03-01T17:38:21.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-21T12:44:49.000Z (about 2 years ago)
- Last Synced: 2024-03-22T13:48:05.132Z (about 2 years ago)
- Language: Kotlin
- Homepage:
- Size: 193 KB
- Stars: 38
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kritor-kotlin
**Kritor** (OneBotX)是一个聊天机器人应用接口标准,
旨在统一腾讯QQ IM平台上的机器人应用开发接口 ,
使开发者只需编写一次业务逻辑代码即可应用到多种机器人平台。
**Kritor-kotlin** 是一个**Kritor**在Kotlin的实现。
## 客户端代码示例
建立一个管道,实例化Grpc的服务,发送一个鉴权请求。
```kotlin
suspend fun main() {
val channel = ManagedChannelBuilder
.forAddress("localhost", 8080)
.usePlaintext()
.build()
val stub = AuthenticationGrpcKt.AuthenticationCoroutineStub(channel)
runCatching {
val rsp = stub.auth(authReq {
account = "1145141919810"
ticket = "A123456"
})
println(rsp.code)
}.onFailure {
println(Status.fromThrowable(it))
}
}
```
## 使用项目
- [Shamrock](https://github.com/whitechi73/OpenShamrock)