From 987931a2c8917b3d67af5147decc3a5539f550c8 Mon Sep 17 00:00:00 2001 From: RTAkland Date: Thu, 3 Oct 2024 15:56:31 +0800 Subject: [PATCH] feat: support more api --- gradle.properties | 2 +- .../rob/entity/lagrange/ForwardMessage.kt | 32 ++++++++++++ .../rtast/rob/entity/lagrange/GetCookies.kt | 16 ++++++ .../entity/out/{ => get}/CanSendImageOut.kt | 2 +- .../entity/out/{ => get}/CanSendRecordOut.kt | 2 +- .../out/{ => get}/GetForwardMessageOut.kt | 2 +- .../entity/out/{ => get}/GetFriendListOut.kt | 2 +- .../entity/out/{ => get}/GetGroupInfoOut.kt | 2 +- .../entity/out/{ => get}/GetGroupListOut.kt | 2 +- .../out/{ => get}/GetGroupMemberInfoOut.kt | 2 +- .../out/{ => get}/GetGroupMemberListOut.kt | 2 +- .../entity/out/{ => get}/GetLoginInfoOut.kt | 2 +- .../rob/entity/out/{ => get}/GetMessageOut.kt | 2 +- .../out/{ => get}/GetStrangerInfoOut.kt | 2 +- .../entity/out/{ => get}/GetVersionInfo.kt | 2 +- .../lagrange/{ => get}/FetchCustomFaceOut.kt | 2 +- .../out/lagrange/{ => get}/GetCSRFTokenOut.kt | 2 +- .../entity/out/lagrange/get/GetCookiesOut.kt | 20 +++++++ .../{ => get}/GetGroupHonorInfoOut.kt | 2 +- .../lagrange/{ => get}/GetMessageHistory.kt | 2 +- .../out/lagrange/{ => get}/GetStatusOut.kt | 2 +- .../out/lagrange/{ => get}/GroupFilesOut.kt | 2 +- .../lagrange/{ => set}/EssenceMessageOut.kt | 2 +- .../out/lagrange/{ => set}/GroupNoticeOut.kt | 2 +- .../out/lagrange/{ => set}/MarkAsReadOut.kt | 2 +- .../entity/out/lagrange/{ => set}/PokeOut.kt | 2 +- .../out/lagrange/{ => set}/ReactionOut.kt | 2 +- .../{ => set}/SendForwardMessageOut.kt | 2 +- .../{ => set}/SetGroupMemberTitleOut.kt | 2 +- .../out/lagrange/{ => set}/UploadFileOut.kt | 2 +- .../out/{ => set}/KickGroupMemberOut.kt | 2 +- .../entity/out/{ => set}/RevokeMessageOut.kt | 2 +- .../rob/entity/out/{ => set}/SendLikeOut.kt | 2 +- .../entity/out/{ => set}/SendMessageOut.kt | 2 +- .../out/{ => set}/SetFriendRequestOut.kt | 2 +- .../entity/out/{ => set}/SetGroupAdminOut.kt | 2 +- .../out/{ => set}/SetGroupAnonymousOut.kt | 2 +- .../entity/out/{ => set}/SetGroupBanOut.kt | 2 +- .../entity/out/{ => set}/SetGroupLeaveOut.kt | 2 +- .../out/{ => set}/SetGroupMemberCardOut.kt | 2 +- .../entity/out/{ => set}/SetGroupNameOut.kt | 2 +- .../out/{ => set}/SetGroupRequestOut.kt | 2 +- .../out/{ => set}/SetGroupWholeBanOut.kt | 2 +- .../rob/enums/internal/MessageEchoType.kt | 3 +- .../cn/rtast/rob/util/ob/OneBotAction.kt | 52 +++++++++++++++---- src/test/kotlin/TestClient.kt | 2 +- 46 files changed, 154 insertions(+), 51 deletions(-) create mode 100644 src/main/kotlin/cn/rtast/rob/entity/lagrange/ForwardMessage.kt create mode 100644 src/main/kotlin/cn/rtast/rob/entity/lagrange/GetCookies.kt rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/CanSendImageOut.kt (88%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/CanSendRecordOut.kt (88%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/GetForwardMessageOut.kt (91%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/GetFriendListOut.kt (88%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/GetGroupInfoOut.kt (93%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/GetGroupListOut.kt (88%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/GetGroupMemberInfoOut.kt (94%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/GetGroupMemberListOut.kt (92%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/GetLoginInfoOut.kt (88%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/GetMessageOut.kt (92%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/GetStrangerInfoOut.kt (93%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => get}/GetVersionInfo.kt (88%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => get}/FetchCustomFaceOut.kt (86%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => get}/GetCSRFTokenOut.kt (85%) create mode 100644 src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetCookiesOut.kt rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => get}/GetGroupHonorInfoOut.kt (91%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => get}/GetMessageHistory.kt (95%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => get}/GetStatusOut.kt (85%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => get}/GroupFilesOut.kt (96%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => set}/EssenceMessageOut.kt (95%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => set}/GroupNoticeOut.kt (96%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => set}/MarkAsReadOut.kt (88%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => set}/PokeOut.kt (92%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => set}/ReactionOut.kt (91%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => set}/SendForwardMessageOut.kt (94%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => set}/SetGroupMemberTitleOut.kt (91%) rename src/main/kotlin/cn/rtast/rob/entity/out/lagrange/{ => set}/UploadFileOut.kt (94%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/KickGroupMemberOut.kt (93%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/RevokeMessageOut.kt (90%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/SendLikeOut.kt (90%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/SendMessageOut.kt (97%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/SetFriendRequestOut.kt (89%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/SetGroupAdminOut.kt (92%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/SetGroupAnonymousOut.kt (91%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/SetGroupBanOut.kt (92%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/SetGroupLeaveOut.kt (91%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/SetGroupMemberCardOut.kt (92%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/SetGroupNameOut.kt (91%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/SetGroupRequestOut.kt (90%) rename src/main/kotlin/cn/rtast/rob/entity/out/{ => set}/SetGroupWholeBanOut.kt (91%) diff --git a/gradle.properties b/gradle.properties index df72105..3aa8926 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ kotlin.code.style=official -libVersion=1.12.5 \ No newline at end of file +libVersion=1.12.6 \ No newline at end of file diff --git a/src/main/kotlin/cn/rtast/rob/entity/lagrange/ForwardMessage.kt b/src/main/kotlin/cn/rtast/rob/entity/lagrange/ForwardMessage.kt new file mode 100644 index 0000000..d416cf6 --- /dev/null +++ b/src/main/kotlin/cn/rtast/rob/entity/lagrange/ForwardMessage.kt @@ -0,0 +1,32 @@ +/* + * Copyright © 2024 RTAkland + * Author: RTAkland + * Date: 2024/10/3 + */ + + +package cn.rtast.rob.entity.lagrange + +import cn.rtast.rob.entity.ArrayMessage +import cn.rtast.rob.enums.ArrayMessageType +import com.google.gson.annotations.SerializedName + +data class ForwardMessage( + val data: Data +) { + data class Data( + val message: List + ) + + data class ForwardArrayMessage( + @SerializedName("user_id") + val userId: Long, + val nickname: String, + val content: List + ) + + data class Content( + val type: ArrayMessageType, + val data: ArrayMessage.Data + ) +} \ No newline at end of file diff --git a/src/main/kotlin/cn/rtast/rob/entity/lagrange/GetCookies.kt b/src/main/kotlin/cn/rtast/rob/entity/lagrange/GetCookies.kt new file mode 100644 index 0000000..a7964dc --- /dev/null +++ b/src/main/kotlin/cn/rtast/rob/entity/lagrange/GetCookies.kt @@ -0,0 +1,16 @@ +/* + * Copyright © 2024 RTAkland + * Author: RTAkland + * Date: 2024/10/3 + */ + + +package cn.rtast.rob.entity.lagrange + +data class GetCookies( + val data: Data +) { + data class Data( + val cookies: String + ) +} \ No newline at end of file diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/CanSendImageOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/CanSendImageOut.kt similarity index 88% rename from src/main/kotlin/cn/rtast/rob/entity/out/CanSendImageOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/CanSendImageOut.kt index 4040fe9..eb58ba4 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/CanSendImageOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/CanSendImageOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/CanSendRecordOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/CanSendRecordOut.kt similarity index 88% rename from src/main/kotlin/cn/rtast/rob/entity/out/CanSendRecordOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/CanSendRecordOut.kt index c2126f9..af76e1f 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/CanSendRecordOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/CanSendRecordOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/GetForwardMessageOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetForwardMessageOut.kt similarity index 91% rename from src/main/kotlin/cn/rtast/rob/entity/out/GetForwardMessageOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/GetForwardMessageOut.kt index 13f1196..b88b3ab 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/GetForwardMessageOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetForwardMessageOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/GetFriendListOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetFriendListOut.kt similarity index 88% rename from src/main/kotlin/cn/rtast/rob/entity/out/GetFriendListOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/GetFriendListOut.kt index b1b8000..da164d8 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/GetFriendListOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetFriendListOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/GetGroupInfoOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupInfoOut.kt similarity index 93% rename from src/main/kotlin/cn/rtast/rob/entity/out/GetGroupInfoOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupInfoOut.kt index 46a77d6..fa674f9 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/GetGroupInfoOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupInfoOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/GetGroupListOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupListOut.kt similarity index 88% rename from src/main/kotlin/cn/rtast/rob/entity/out/GetGroupListOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupListOut.kt index b1d0967..e4311c5 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/GetGroupListOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupListOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/GetGroupMemberInfoOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupMemberInfoOut.kt similarity index 94% rename from src/main/kotlin/cn/rtast/rob/entity/out/GetGroupMemberInfoOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupMemberInfoOut.kt index 6e8aa3b..b79e549 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/GetGroupMemberInfoOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupMemberInfoOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/GetGroupMemberListOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupMemberListOut.kt similarity index 92% rename from src/main/kotlin/cn/rtast/rob/entity/out/GetGroupMemberListOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupMemberListOut.kt index 12b5879..4eeeab5 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/GetGroupMemberListOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetGroupMemberListOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/GetLoginInfoOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetLoginInfoOut.kt similarity index 88% rename from src/main/kotlin/cn/rtast/rob/entity/out/GetLoginInfoOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/GetLoginInfoOut.kt index 297e664..67c36a5 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/GetLoginInfoOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetLoginInfoOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/GetMessageOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetMessageOut.kt similarity index 92% rename from src/main/kotlin/cn/rtast/rob/entity/out/GetMessageOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/GetMessageOut.kt index 48f0d87..90026cf 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/GetMessageOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetMessageOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/GetStrangerInfoOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetStrangerInfoOut.kt similarity index 93% rename from src/main/kotlin/cn/rtast/rob/entity/out/GetStrangerInfoOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/GetStrangerInfoOut.kt index 2b5a392..8ab2e32 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/GetStrangerInfoOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetStrangerInfoOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/GetVersionInfo.kt b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetVersionInfo.kt similarity index 88% rename from src/main/kotlin/cn/rtast/rob/entity/out/GetVersionInfo.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/get/GetVersionInfo.kt index d3baa65..ecfe536 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/GetVersionInfo.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/get/GetVersionInfo.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.get import cn.rtast.rob.enums.internal.MessageEchoType diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/FetchCustomFaceOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/FetchCustomFaceOut.kt similarity index 86% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/FetchCustomFaceOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/FetchCustomFaceOut.kt index c48c6a6..2af5f03 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/FetchCustomFaceOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/FetchCustomFaceOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.get import cn.rtast.rob.enums.internal.MessageEchoType diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetCSRFTokenOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetCSRFTokenOut.kt similarity index 85% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetCSRFTokenOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetCSRFTokenOut.kt index b1bf83f..054a98f 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetCSRFTokenOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetCSRFTokenOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.get import cn.rtast.rob.enums.internal.MessageEchoType diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetCookiesOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetCookiesOut.kt new file mode 100644 index 0000000..43981ae --- /dev/null +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetCookiesOut.kt @@ -0,0 +1,20 @@ +/* + * Copyright © 2024 RTAkland + * Author: RTAkland + * Date: 2024/10/3 + */ + + +package cn.rtast.rob.entity.out.lagrange.get + +import cn.rtast.rob.enums.internal.MessageEchoType + +internal data class GetCookiesOut( + val action: String = "get_cookies", + val echo: MessageEchoType = MessageEchoType.GetCookies, + val params: Params +) { + data class Params( + val domain: String, + ) +} \ No newline at end of file diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetGroupHonorInfoOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetGroupHonorInfoOut.kt similarity index 91% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetGroupHonorInfoOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetGroupHonorInfoOut.kt index c417747..94ccacf 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetGroupHonorInfoOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetGroupHonorInfoOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.get import cn.rtast.rob.enums.internal.MessageEchoType import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetMessageHistory.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetMessageHistory.kt similarity index 95% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetMessageHistory.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetMessageHistory.kt index 534a9d9..74caad1 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetMessageHistory.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetMessageHistory.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.get import cn.rtast.rob.enums.internal.MessageEchoType import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetStatusOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetStatusOut.kt similarity index 85% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetStatusOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetStatusOut.kt index e2f916c..4a33b0f 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GetStatusOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GetStatusOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.get import cn.rtast.rob.enums.internal.MessageEchoType diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GroupFilesOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GroupFilesOut.kt similarity index 96% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GroupFilesOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GroupFilesOut.kt index b333c16..5eedd19 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GroupFilesOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/get/GroupFilesOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.get import cn.rtast.rob.enums.internal.MessageEchoType import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/EssenceMessageOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/EssenceMessageOut.kt similarity index 95% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/EssenceMessageOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/EssenceMessageOut.kt index 96837d1..6353130 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/EssenceMessageOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/EssenceMessageOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.set import cn.rtast.rob.enums.internal.MessageEchoType import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GroupNoticeOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/GroupNoticeOut.kt similarity index 96% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GroupNoticeOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/GroupNoticeOut.kt index 508d324..eabe540 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/GroupNoticeOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/GroupNoticeOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.set import cn.rtast.rob.enums.internal.MessageEchoType import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/MarkAsReadOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/MarkAsReadOut.kt similarity index 88% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/MarkAsReadOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/MarkAsReadOut.kt index 79cbc48..889c98c 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/MarkAsReadOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/MarkAsReadOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/PokeOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/PokeOut.kt similarity index 92% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/PokeOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/PokeOut.kt index e912b75..4fd9133 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/PokeOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/PokeOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/ReactionOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/ReactionOut.kt similarity index 91% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/ReactionOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/ReactionOut.kt index f7633de..6f3c7a2 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/ReactionOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/ReactionOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/SendForwardMessageOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/SendForwardMessageOut.kt similarity index 94% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/SendForwardMessageOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/SendForwardMessageOut.kt index bbcd136..941f51a 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/SendForwardMessageOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/SendForwardMessageOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.set import cn.rtast.rob.enums.internal.MessageEchoType import cn.rtast.rob.segment.Node diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/SetGroupMemberTitleOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/SetGroupMemberTitleOut.kt similarity index 91% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/SetGroupMemberTitleOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/SetGroupMemberTitleOut.kt index 3ae938a..816b10a 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/SetGroupMemberTitleOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/SetGroupMemberTitleOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/UploadFileOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/UploadFileOut.kt similarity index 94% rename from src/main/kotlin/cn/rtast/rob/entity/out/lagrange/UploadFileOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/UploadFileOut.kt index f9e301e..267f3ad 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/UploadFileOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/lagrange/set/UploadFileOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out.lagrange +package cn.rtast.rob.entity.out.lagrange.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/KickGroupMemberOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/KickGroupMemberOut.kt similarity index 93% rename from src/main/kotlin/cn/rtast/rob/entity/out/KickGroupMemberOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/KickGroupMemberOut.kt index 01dbea8..02a5d2d 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/KickGroupMemberOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/KickGroupMemberOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/RevokeMessageOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/RevokeMessageOut.kt similarity index 90% rename from src/main/kotlin/cn/rtast/rob/entity/out/RevokeMessageOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/RevokeMessageOut.kt index 9448028..005d176 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/RevokeMessageOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/RevokeMessageOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/SendLikeOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/SendLikeOut.kt similarity index 90% rename from src/main/kotlin/cn/rtast/rob/entity/out/SendLikeOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/SendLikeOut.kt index 39a6efe..a70f965 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/SendLikeOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/SendLikeOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/SendMessageOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/SendMessageOut.kt similarity index 97% rename from src/main/kotlin/cn/rtast/rob/entity/out/SendMessageOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/SendMessageOut.kt index 95a2249..1738a61 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/SendMessageOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/SendMessageOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set import cn.rtast.rob.entity.ArrayMessage import cn.rtast.rob.segment.BaseSegment diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/SetFriendRequestOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetFriendRequestOut.kt similarity index 89% rename from src/main/kotlin/cn/rtast/rob/entity/out/SetFriendRequestOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/SetFriendRequestOut.kt index eed14cc..f7a4c8a 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/SetFriendRequestOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetFriendRequestOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set internal data class SetFriendRequestOut( val action: String = "set_friend_add_request", diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupAdminOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupAdminOut.kt similarity index 92% rename from src/main/kotlin/cn/rtast/rob/entity/out/SetGroupAdminOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupAdminOut.kt index d151658..5b938cb 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupAdminOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupAdminOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupAnonymousOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupAnonymousOut.kt similarity index 91% rename from src/main/kotlin/cn/rtast/rob/entity/out/SetGroupAnonymousOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupAnonymousOut.kt index c6932ea..bd912b5 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupAnonymousOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupAnonymousOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupBanOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupBanOut.kt similarity index 92% rename from src/main/kotlin/cn/rtast/rob/entity/out/SetGroupBanOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupBanOut.kt index 77721a3..fb1239b 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupBanOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupBanOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupLeaveOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupLeaveOut.kt similarity index 91% rename from src/main/kotlin/cn/rtast/rob/entity/out/SetGroupLeaveOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupLeaveOut.kt index b832a14..d4f9431 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupLeaveOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupLeaveOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupMemberCardOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupMemberCardOut.kt similarity index 92% rename from src/main/kotlin/cn/rtast/rob/entity/out/SetGroupMemberCardOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupMemberCardOut.kt index 6f6d4c4..b8eb669 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupMemberCardOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupMemberCardOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupNameOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupNameOut.kt similarity index 91% rename from src/main/kotlin/cn/rtast/rob/entity/out/SetGroupNameOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupNameOut.kt index a033c2c..a80741c 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupNameOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupNameOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupRequestOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupRequestOut.kt similarity index 90% rename from src/main/kotlin/cn/rtast/rob/entity/out/SetGroupRequestOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupRequestOut.kt index 8fb8dd9..734f609 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupRequestOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupRequestOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set internal data class SetGroupRequestOut( val action: String = "set_group_add_request", diff --git a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupWholeBanOut.kt b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupWholeBanOut.kt similarity index 91% rename from src/main/kotlin/cn/rtast/rob/entity/out/SetGroupWholeBanOut.kt rename to src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupWholeBanOut.kt index 12e7769..f19b14c 100644 --- a/src/main/kotlin/cn/rtast/rob/entity/out/SetGroupWholeBanOut.kt +++ b/src/main/kotlin/cn/rtast/rob/entity/out/set/SetGroupWholeBanOut.kt @@ -5,7 +5,7 @@ */ -package cn.rtast.rob.entity.out +package cn.rtast.rob.entity.out.set import com.google.gson.annotations.SerializedName diff --git a/src/main/kotlin/cn/rtast/rob/enums/internal/MessageEchoType.kt b/src/main/kotlin/cn/rtast/rob/enums/internal/MessageEchoType.kt index d308ecf..5478a61 100644 --- a/src/main/kotlin/cn/rtast/rob/enums/internal/MessageEchoType.kt +++ b/src/main/kotlin/cn/rtast/rob/enums/internal/MessageEchoType.kt @@ -18,5 +18,6 @@ internal enum class MessageEchoType { GetGroupNotice, ReleaseGroupNotice, GetEssenceMessageList, GetGroupHonorInfo, GetCSRFToken, GetGroupMessageHistory, - GetPrivateMessageHistory, GetStatus + GetPrivateMessageHistory, GetStatus, + GetCookies } \ No newline at end of file diff --git a/src/main/kotlin/cn/rtast/rob/util/ob/OneBotAction.kt b/src/main/kotlin/cn/rtast/rob/util/ob/OneBotAction.kt index 8a33366..3194557 100644 --- a/src/main/kotlin/cn/rtast/rob/util/ob/OneBotAction.kt +++ b/src/main/kotlin/cn/rtast/rob/util/ob/OneBotAction.kt @@ -15,11 +15,34 @@ import cn.rtast.rob.entity.* import cn.rtast.rob.entity.lagrange.* import cn.rtast.rob.entity.metadata.HeartBeatEvent import cn.rtast.rob.entity.metadata.OneBotVersionInfo -import cn.rtast.rob.entity.out.* -import cn.rtast.rob.entity.out.lagrange.* -import cn.rtast.rob.entity.out.lagrange.FriendPokeOut -import cn.rtast.rob.entity.out.lagrange.GroupPokeOut -import cn.rtast.rob.entity.out.lagrange.SendPrivateForwardMsgOut +import cn.rtast.rob.entity.out.get.* +import cn.rtast.rob.entity.out.get.CanSendImageOut +import cn.rtast.rob.entity.out.get.GetFriendListOut +import cn.rtast.rob.entity.out.get.GetGroupMemberInfoOut +import cn.rtast.rob.entity.out.get.GetGroupMemberListOut +import cn.rtast.rob.entity.out.get.GetLoginInfoOut +import cn.rtast.rob.entity.out.lagrange.set.FriendPokeOut +import cn.rtast.rob.entity.out.lagrange.set.GroupPokeOut +import cn.rtast.rob.entity.out.lagrange.get.* +import cn.rtast.rob.entity.out.lagrange.get.GetCSRFTokenOut +import cn.rtast.rob.entity.out.lagrange.get.GetGroupFileUrlOut +import cn.rtast.rob.entity.out.lagrange.get.GetGroupFilesByFolderOut +import cn.rtast.rob.entity.out.lagrange.get.GetGroupHonorInfoOut +import cn.rtast.rob.entity.out.lagrange.get.GetGroupRootFilesOut +import cn.rtast.rob.entity.out.lagrange.set.* +import cn.rtast.rob.entity.out.lagrange.set.DeleteEssenceMessageOut +import cn.rtast.rob.entity.out.lagrange.set.GetEssenceMessageListOut +import cn.rtast.rob.entity.out.lagrange.set.ReactionOut +import cn.rtast.rob.entity.out.lagrange.set.SendGroupForwardMsgOut +import cn.rtast.rob.entity.out.lagrange.set.SendPrivateForwardMsgOut +import cn.rtast.rob.entity.out.lagrange.set.SetEssenceMessageOut +import cn.rtast.rob.entity.out.lagrange.set.SetGroupMemberTitleOut +import cn.rtast.rob.entity.out.set.* +import cn.rtast.rob.entity.out.set.KickGroupMemberOut +import cn.rtast.rob.entity.out.set.SetFriendRequestOut +import cn.rtast.rob.entity.out.set.SetGroupAdminOut +import cn.rtast.rob.entity.out.set.SetGroupBanOut +import cn.rtast.rob.entity.out.set.SetGroupLeaveOut import cn.rtast.rob.enums.HonorType import cn.rtast.rob.enums.internal.MessageEchoType import cn.rtast.rob.util.fromJson @@ -659,13 +682,12 @@ interface OneBotAction { /** * 该方法是Lagrange.OneBot的拓展API * 用于获取一个合并转发消息链中的内容 - * 内容解析并未实现返回的是原始json文本请自行解析 - * 2024/10/03 11:46 */ - suspend fun getForwardMessage(id: String): String { + suspend fun getForwardMessage(id: String): ForwardMessage.Data { val deferred = this.createCompletableDeferred(MessageEchoType.GetForwardMessage) this.send(GetForwardMessageOut(params = GetForwardMessageOut.Params(id))) - return deferred.await() + val response = deferred.await() + return response.fromJson().data } /** @@ -678,4 +700,16 @@ interface OneBotAction { val response = deferred.await() return response.fromJson().data } + + /** + * 该方法是Lagrange.OneBot的拓展API + * 用于获取机器人账号对应某个域名的Cookie + * 可以传入`vip.qq.com` `docs.qq.com`等等一系列域名 + */ + suspend fun getCookies(domain: String): String { + val deferred = this.createCompletableDeferred(MessageEchoType.GetCookies) + this.send(GetCookiesOut(params = GetCookiesOut.Params(domain))) + val response = deferred.await() + return response.fromJson().data.cookies + } } \ No newline at end of file diff --git a/src/test/kotlin/TestClient.kt b/src/test/kotlin/TestClient.kt index 363805c..1098c1b 100644 --- a/src/test/kotlin/TestClient.kt +++ b/src/test/kotlin/TestClient.kt @@ -13,7 +13,7 @@ fun main() { val wsAccessToken = System.getenv("WS_ACCESS_TOKEN") val rob = ROneBotFactory.createClient(wsAddress, wsAccessToken, object : OneBotListener { override suspend fun onGroupMessage(message: GroupMessage, json: String) { - println(this.getStatus()) + println(this.getCookies("vip.qq.com")) } }) rob.commandManager.register(EchoCommand()) // not a suspend function