Skip to content

Commit

Permalink
0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
yyuueexxiinngg committed Nov 28, 2020
1 parent 79e8cc2 commit b62be3f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## `0.3.3` *2020/xx/xx*
- 再次修复`xml`以及`json`消息的字段不正确
## `0.3.3` *2020/11/28*
- **修复反向Websocket客户端概率出现未清除会话导致无法重连的问题** #81
- 再次修复`xml`以及`json`消息的字段不正确 #112
- 支持接收及发送闪照 #114
- 支持通过`json`发送程序分享富文本消息, 类似 ```{\"app\":\"com.tencent.weather\", ....```
- 支持接收群组及好友消息撤回事件 *(获取消息接口尚未支持)*
- HTTP上报服务支持超时, `http`配置项中增加`timeout`配置 #113
- 富文本消息段类型跟随OneBot标准使用`json`, `xml`, 弃用`rich`


## `0.3.2` *2020/11/23*
### **修复因合并`embedded`分支而在`0.3.1`中引入的`Array`格式消息上报序列化格式错误**
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# OneBot Mirai - CQHTTP Mirai

[![OneBot v10](https://img.shields.io/badge/OneBot-v10-black)](https://github.com/howmanybots/onebot/blob/master/v10/specs/README.md)
[![Gradle CI](https://github.com/yyuueexxiinngg/onebot-kotlin/workflows/Gradle%20CI/badge.svg)](https://github.com/yyuueexxiinngg/onebot-kotlin/actions)
[![Downloads](https://img.shields.io/github/downloads/yyuueexxiinngg/onebot-kotlin/total)](https://github.com/yyuueexxiinngg/onebot-kotlin/releases)
[![Release](https://img.shields.io/github/v/release/yyuueexxiinngg/onebot-kotlin?include_prereleases)](https://github.com/yyuueexxiinngg/onebot-kotlin/releases)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ suspend fun cqMessageToMessageChains(
cqMessage: Any?,
raw: Boolean = false
): MessageChain? {
return when (cqMessage) {
when (cqMessage) {
is String -> {
return if (raw) {
PlainText(cqMessage).asMessageChain()
Expand Down Expand Up @@ -105,7 +105,7 @@ suspend fun cqMessageToMessageChains(


private suspend fun cqTextToMessageInternal(bot: Bot, contact: Contact?, message: Any): Message {
return when (message) {
when (message) {
is String -> {
if (message.startsWith("[CQ:") && message.endsWith("]")) {
val parts = message.substring(4, message.length - 1).split(delimiters = arrayOf(","), limit = 2)
Expand All @@ -126,7 +126,7 @@ private suspend fun cqTextToMessageInternal(bot: Bot, contact: Contact?, message
val args = data.jsonObject.keys.map { it to data.jsonObject[it]!!.jsonPrimitive.content }.toMap()
return convertToMiraiMessage(bot, contact, type, args)
}
else -> MSG_EMPTY
else -> return MSG_EMPTY
}
}

Expand Down Expand Up @@ -197,6 +197,7 @@ private suspend fun convertToMiraiMessage(
}
return MSG_EMPTY
}
// Could be changed at anytime.
"nudge" -> {
val target = args["qq"] ?: error("Nudge target `qq` must not ne null.")
if (contact is Group) {
Expand Down

0 comments on commit b62be3f

Please sign in to comment.