@alemonjs/bubble 2.1.0-alpha.3 → 2.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/sdk/api.d.ts +3 -1
- package/lib/sdk/api.js +0 -3
- package/lib/send.js +3 -3
- package/package.json +1 -1
package/lib/sdk/api.d.ts
CHANGED
package/lib/sdk/api.js
CHANGED
|
@@ -71,9 +71,6 @@ class BubbleAPI {
|
|
|
71
71
|
if (extra.threadId) {
|
|
72
72
|
form.append('threadId', String(extra.threadId));
|
|
73
73
|
}
|
|
74
|
-
if (extra.messageId) {
|
|
75
|
-
form.append('messageId', String(extra.messageId));
|
|
76
|
-
}
|
|
77
74
|
const value = getBubbleConfig();
|
|
78
75
|
const token = value.token;
|
|
79
76
|
const requestConfig = value.request_config ?? {};
|
package/lib/send.js
CHANGED
|
@@ -70,9 +70,9 @@ const sendToRoom = async (client, param, val) => {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
const uploadRes = await client.uploadFile(bufferData, undefined, { channelId, threadId, messageId: messageId });
|
|
73
|
-
const fileAttachment = uploadRes?.file;
|
|
73
|
+
const fileAttachment = uploadRes?.data?.file;
|
|
74
74
|
if (!fileAttachment) {
|
|
75
|
-
|
|
75
|
+
return [createResult(ResultCode.Ok, '文件上传失败:未返回文件信息', uploadRes)];
|
|
76
76
|
}
|
|
77
77
|
if (channelId) {
|
|
78
78
|
const res = await client.sendMessage(channelId, {
|
|
@@ -143,7 +143,7 @@ const sendToRoom = async (client, param, val) => {
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
if ((content && content.length > 0 || contentMd && contentMd.length > 0)) {
|
|
146
|
+
if ((content && content.length > 0) || (contentMd && contentMd.length > 0)) {
|
|
147
147
|
if (channelId) {
|
|
148
148
|
const res = await client.sendMessage(channelId, { content: content ?? contentMd, type: 'text' });
|
|
149
149
|
return [createResult(ResultCode.Ok, '完成', res)];
|