You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/utils/MessageUtil.kt
+21-13Lines changed: 21 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -101,19 +101,7 @@ internal fun sendMsgApi(
101
101
autoEscape =true
102
102
)
103
103
} else {
104
-
val newMessage =ArrayList<OneBotMessageSegment>(message.size +1)
105
-
var hasReply =false
106
-
for (segment in message) {
107
-
if (!hasReply && segment isOneBotReply) {
108
-
hasReply =true
109
-
}
110
-
111
-
newMessage.add(segment)
112
-
}
113
-
114
-
if (!hasReply) {
115
-
newMessage.add(OneBotReply.create(reply))
116
-
}
104
+
val newMessage = resolveReplyMessageSegmentList(message, reply)
117
105
118
106
SendMsgApi.create(
119
107
messageType = messageType,
@@ -124,6 +112,26 @@ internal fun sendMsgApi(
124
112
}
125
113
}
126
114
115
+
internalfunresolveReplyMessageSegmentList(
116
+
message:List<OneBotMessageSegment>,
117
+
reply:ID,
118
+
): List<OneBotMessageSegment> {
119
+
val newMessage =ArrayList<OneBotMessageSegment>(message.size +1)
0 commit comments