Skip to content

Commit

Permalink
1. QuoteReply now will be parsed to emptystring instead of "此处消息的转义尚未…
Browse files Browse the repository at this point in the history
…被插件支持"

2. Fix result serialization error of getting group member list.
  • Loading branch information
yyuueexxiinngg committed Jun 5, 2020
1 parent b9d0ae4 commit 0029a1f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "yyuueexxiinngg"
version = "0.1.3"
version = "0.1.4"

repositories {
maven(url = "https://mirrors.huaweicloud.com/repository/maven")
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/tech/mihoyo/mirai/MiraiApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,11 @@ class MiraiApi(val bot: Bot) {

fun cqGetGroupMemberList(params: Map<String, JsonElement>): CQResponseDTO {
val groupId = params["group_id"]?.long
val cqGroupList = mutableListOf<CQMemberDTO>()
val cqGroupMemberListData = mutableListOf<CQMemberInfoData>()
return if (groupId != null) {
val members = bot.getGroup(groupId).members
members.forEach { member -> cqGroupList.add(CQMemberDTO(member)) }
CQResponseDTO.CQMemberList(cqGroupList)
members.forEach { member -> cqGroupMemberListData.add(CQMemberInfoData(member)) }
CQResponseDTO.CQMemberList(cqGroupMemberListData)
} else {
CQResponseDTO.CQInvalidRequest()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ suspend fun Message.toCQString(): String {
}
is RichMessage -> "[CQ:rich,data=${content}]"
is MessageSource -> ""
is QuoteReply -> ""
else -> "此处消息的转义尚未被插件支持"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ open class CQResponseDTO(
CQResponseDTO("ok", 0, CQGroupInfoData(group_id, group_name, member_count, max_member_count))

class CQMemberInfo(member: CQMemberInfoData) : CQResponseDTO("ok", 0, member)
class CQMemberList(memberList: List<CQMemberDTO>) : CQResponseDTO("ok", 0, memberList)
class CQMemberList(memberList: List<CQMemberInfoData>) : CQResponseDTO("ok", 0, memberList)
class CQCanSendImage(data: CQCanSendImageData = CQCanSendImageData()) : CQResponseDTO("ok", 0, data)
class CQCanSendRecord(data: CQCanSendRecordData = CQCanSendRecordData()) : CQResponseDTO("ok", 0, data)
class CQPluginStatus(status: CQPluginStatusData) : CQResponseDTO("ok", 0, status)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "CQHTTPMirai"
author: "yyuueexxiinngg"
version: "0.1.3"
version: "0.1.4"
vcs: "https://github.com/yyuueexxiinngg/cqhttp-mirai"
main: "tech.mihoyo.mirai.PluginBase"
info: "Mirai to CoolQ HTTP API Plugin"
Expand Down

0 comments on commit 0029a1f

Please sign in to comment.