diff --git a/CHANGELOG.md b/CHANGELOG.md index 3298927..25abfd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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`格式消息上报序列化格式错误** diff --git a/README.md b/README.md index 3d3d6ae..76c7ff5 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/onebot-mirai/src/main/kotlin/com/github/yyuueexxiinngg/onebot/util/CQMessgeParser.kt b/onebot-mirai/src/main/kotlin/com/github/yyuueexxiinngg/onebot/util/CQMessgeParser.kt index 596529f..0c60a3c 100644 --- a/onebot-mirai/src/main/kotlin/com/github/yyuueexxiinngg/onebot/util/CQMessgeParser.kt +++ b/onebot-mirai/src/main/kotlin/com/github/yyuueexxiinngg/onebot/util/CQMessgeParser.kt @@ -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() @@ -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) @@ -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 } } @@ -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) {